Package: dash
Version: 0.5.11+git20200708+dd9ef66-2
Severity: important
Tags: patch
Control: block #972571 by -1

Hi,

this report is similar to https://bugs.debian.org/606756 from 2010. I
also am removing documentation in /usr/share/man and this leads for the
dash postinst to fail. To reproduce my findings, run:

    $ mmdebstrap --variant=apt --dpkgopt=path-exclude='/usr/share/man/*' 
unstable /dev/null

Using the dpkg path-exclude functionality, no directory exists in
/usr/share/man/ to save space. When running the above you will receive
the following error:

    Setting up dash (0.5.11+git20200708+dd9ef66-2) ...
    No diversion 'diversion of /bin/sh by bash', none removed.
    Adding 'diversion of /bin/sh to /bin/sh.distrib by dash'
    No diversion 'diversion of /usr/share/man/man1/sh.1.gz by bash', none 
removed.
    Adding 'diversion of /usr/share/man/man1/sh.1.gz to 
/usr/share/man/man1/sh.distrib.1.gz by dash'
    ln: failed to create symbolic link '/usr/share/man/man1/sh.1.gz.tmp': No 
such file or directory
    dpkg: error processing package dash (--install):
     installed dash package post-installation script subprocess returned error 
exit status 1

The following patch to dash fixes the problem:

--- a/debian/dash.postinst
+++ b/debian/dash.postinst
@@ -132,8 +132,10 @@ if [ $debconf ]; then
        db_get dash/sh
        if [ "$RET" = true ]; then
                claim_binsh /bin/sh dash
+               if [ -d /usr/share/man/man1/ ]; then
                claim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \
                        /usr/share/man/man1/sh.distrib.1.gz
+               fi
        else
                unclaim_binsh /bin/sh dash
                unclaim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \

Thanks!

cheers, josch

Reply via email to