Package: dash
Version: 0.5.11+git20210120+802ebd4-1
Tags: patch

dash.postinst still contains code that handles diversions of /bin/sh
performed by ash. At least since sarge, ash no longer performs such
diversions. Since skipping stable release upgrades is unsupported, this
code can go away without replacement. Please consider applying the
attached patch.

Why is this useful?
 * Less code means less opportunities for bugs.
 * When whole maintainer scripts can be removed, things become easier
   for dpkg.
 * Less code needs to be updated for DPKG_ROOT.

Helmut
diff --minimal -Nru dash-0.5.11+git20210120+802ebd4/debian/changelog 
dash-0.5.11+git20210120+802ebd4/debian/changelog
--- dash-0.5.11+git20210120+802ebd4/debian/changelog    2021-03-04 
10:22:32.000000000 +0100
+++ dash-0.5.11+git20210120+802ebd4/debian/changelog    2021-06-03 
12:36:17.000000000 +0200
@@ -1,3 +1,10 @@
+dash (0.5.11+git20210120+802ebd4-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * dash.postinst: Remove upgrade path from pre-sarge ash. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Thu, 03 Jun 2021 12:36:17 +0200
+
 dash (0.5.11+git20210120+802ebd4-1) unstable; urgency=medium
 
   * New upstream snapshot.
diff --minimal -Nru dash-0.5.11+git20210120+802ebd4/debian/dash.postinst 
dash-0.5.11+git20210120+802ebd4/debian/dash.postinst
--- dash-0.5.11+git20210120+802ebd4/debian/dash.postinst        2021-03-04 
10:22:32.000000000 +0100
+++ dash-0.5.11+git20210120+802ebd4/debian/dash.postinst        2021-06-03 
12:36:11.000000000 +0200
@@ -73,37 +73,6 @@
        replace_with_link $dfile $ltarget $distrib
 }
 
-initial_binsh_setup() {
-       dfile=$1 ltarget=$2 distrib=${3:-$dfile.distrib} ashfile=$4
-       diverter=$(dpkg-divert --listpackage $dfile)
-       truename=$(dpkg-divert --truename $dfile)
-
-       if [ -z "$diverter" ]; then
-               # good.
-               return
-       fi
-
-       if [ "$diverter" = ash ]; then
-               dpkg-divert --package ash --no-rename --remove $dfile
-               dpkg-divert --package dash --no-rename --divert $distrib --add 
$dfile
-
-               if [ "$truename" != "$distrib" ] && [ -e "$truename" ]; then
-                       mv "$truename" "$distrib"
-               fi
-               replace_with_link $dfile $ltarget
-               return
-       fi
-
-       if
-               [ -h $dfile ] &&
-               [ -f $dfile ] &&
-               [ -f $ashfile ] &&
-               cmp $dfile $ashfile
-       then
-               replace_with_link $dfile $ltarget
-       fi
-}
-
 add_shell() {
        if ! type add-shell > /dev/null 2>&1; then
                return
@@ -118,13 +87,8 @@
        debconf=yes
 fi
 
-if [ "$1" = configure ] && [ -z "$2" ]; then
-       initial_binsh_setup /bin/sh dash '' /bin/ash
-       initial_binsh_setup /usr/share/man/man1/sh.1.gz dash.1.gz \
-               /usr/share/man/man1/sh.distrib.1.gz \
-               /usr/share/man/man1/ash.1.gz
-       add_shell
-elif [ "$1" = configure ] && dpkg --compare-versions "$2" lt 0.4.18; then
+# The empty version string used for initial configuration also compares less.
+if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 0.4.18; then
        add_shell
 fi
 

Reply via email to