Package: dash
Version: 0.5.8-2.10
Severity: normal

The fix for #604873

,----
|   [ Jonathan Nieder ]
|   * debian/dash.preinst:
|     - rewrite in C (closes: #604873).
|     - if dash's copy of /bin/sh is not already diverted, divert it
|       on behalf of bash.  This ensures extracting a new version of
|       dash does not overwrite /bin/sh and handling of that symlink
|       is left to postinst.  Likewise for .../man/man1/sh.1.gz.
|     - if /bin/sh is not executable (for example because it is a
|       symlink to a nonexistent file), replace it with a symlink to
|       dash.  Likewise for /usr/share/man/man1/sh.1.gz.
`----

causes dpkg-divert noise on every upgrade:

,----
| Preparing to unpack .../dash_0.5.8-2.10_i386.deb ...
| Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
| Adding 'diversion of /bin/sh to /bin/sh.distrib by bash'
| Removing 'diversion of /usr/share/man/man1/sh.1.gz to 
/usr/share/man/man1/sh.distrib.1.gz by dash'
| Adding 'diversion of /usr/share/man/man1/sh.1.gz to 
/usr/share/man/man1/sh.distrib.1.gz by bash'
| Unpacking dash (0.5.8-2.10) over (0.5.8-2.10) ...
| Setting up dash (0.5.8-2.10) ...
| Removing 'diversion of /bin/sh to /bin/sh.distrib by bash'
| Adding 'diversion of /bin/sh to /bin/sh.distrib by dash'
| Removing 'diversion of /usr/share/man/man1/sh.1.gz to 
/usr/share/man/man1/sh.distrib.1.gz by bash'
| Adding 'diversion of /usr/share/man/man1/sh.1.gz to 
/usr/share/man/man1/sh.distrib.1.gz by dash'
`----

It might have been necessary at the time it was written, but bash no
longer ships the /bin/sh symlink (since version 4.2-1, released over six
years ago).  Can we please stop the dpkg-divert game if /bin/sh already
points at dash?

I still think this preinst is rather useless, because

- dpkg will refuse to run by default if it cannot find /bin/sh, so dash
  can only be installed with the "--force-bad-path" option.  If that is
  the case, the admin might just as well fix the /bin/sh link
  themselves.

- The prerm script is run before the preinst at upgrades, and is
  executed by /bin/sh.  This is what happens when trying to upgrade from
  the broken 0.5.8-2.6 version:

,----
| # dpkg --force-bad-path -i dash_0.5.8-2.10_i386.deb
| dpkg: warning: 'sh' not found in PATH or not executable
| dpkg: warning: overriding problem because --force enabled:
| dpkg: warning: 1 expected program not found in PATH or not executable
| Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
| (Reading database ... 14111 files and directories currently installed.)
| Preparing to unpack dash_0.5.8-2.10_i386.deb ...
| dpkg (subprocess): unable to execute old dash package pre-removal script 
(/var/lib/dpkg/info/dash.prerm): No such file or directory
| dpkg: warning: old dash package pre-removal script subprocess returned error 
exit status 2
| dpkg: trying script from the new package instead ...
| dpkg (subprocess): unable to execute new dash package pre-removal script 
(/var/lib/dpkg/tmp.ci/prerm): No such file or directory
| dpkg: error processing archive dash_0.5.8-2.10_i386.deb (--install):
|  new dash package pre-removal script subprocess returned error exit status 2
| dpkg (subprocess): unable to execute installed dash package post-installation 
script (/var/lib/dpkg/info/dash.postinst): No such file or directory
| dpkg: error while cleaning up:
|  installed dash package post-installation script subprocess returned error 
exit status 2
| Errors were encountered while processing:
|  dash_0.5.8-2.10_i386.deb
`----

As you can see, the preinst did not even get a chance to run.


-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.15.2-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dash depends on:
ii  debianutils  4.8.4
ii  dpkg         1.19.0.5
ii  libc6        2.26-6

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true

Reply via email to