Debian Codegraph @

debian/dash.preinst

raw
1 #!/bin/sh
2
3 set -e
4
5 if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 0.5.12-9~; then
6 # Upgrading from pre-/usr-move DEP17
7 truename=$(dpkg-divert --truename /bin/sh)
8 if [ "$truename" != /bin/sh ] &&
9 [ "$(dpkg-divert --listpackage /bin/sh)_$truename" != "dash_/bin/sh.distrib" ] &&
10 [ "$(dpkg-divert --truename /usr/bin/sh)" = "/usr/bin/sh" ]; then
11 # There is a diversion of /bin/sh and it is not our own
12 # diversion to /bin/sh.distrib that will be removed in
13 # postinst and there is no matching diversion of /usr/bin/sh.
14 if [ -f /usr/share/debconf/confmodule ]; then
15 . /usr/share/debconf/confmodule
16 db_input critical dash/ineffectivediversion || true
17 db_go || true
18 # We have no other debconf usage in dash, so we can purge rightaway.
19 db_purge || true
20 else
21 # The chances of anyone hitting this branch are very slim.
22 # If they do, they will appreciate letting them change their diversion.
23 echo "ERROR: Found ineffective diversion of /bin/sh!" >&2
24 echo "To keep using alternative default shell, divert /usr/bin/sh instead." >&2
25 echo "Aborting upgrade. Resolve the issue and try again." >&2
26 exit 1
27 fi
28 fi
29 fi
30
31 #DEBHELPER#
32
33 exit 0