|
|
@@ -14,135 +14,6 @@
|
|
|
# If postrm fails during upgrade or fails on failed upgrade:
|
|
|
# <old-preinst> abort-upgrade <new-version>
|
|
|
|
|
|
-
|
|
|
-# Confirm that users are aware that conffile changes will be lost
|
|
|
-confirm_conffile_stomp() {
|
|
|
- tempfile=/var/lib/dpkg/bp.$$
|
|
|
-
|
|
|
- trap 'status=$?; rm -f $tempfile; exit $status' 0
|
|
|
- perl -000 -ne 'print $x if m/^Package:\s+(\S+\n)/im &&
|
|
|
- ($x=$1) ne "dpkg\n" &&
|
|
|
- m/^Status:.*(unpacked|postinst)/im' \
|
|
|
- /var/lib/dpkg/status >$tempfile
|
|
|
-
|
|
|
- if [ -s $tempfile ]; then
|
|
|
- echo "
|
|
|
-WARNING - have you read the release notes for this upgrade ?
|
|
|
-
|
|
|
-The following packages have been unpacked but not yet configured:"
|
|
|
- echo " "`cat $tempfile`
|
|
|
-
|
|
|
- echo -n "
|
|
|
-If you proceed with the dpkg upgrade with these packages in this state
|
|
|
-you will LOSE ANY CONFIGURATION CHANGES that have been made to their
|
|
|
-configuration files. I recommend that you back out of the upgrade
|
|
|
-now (see below) and then configure each of these packages using:
|
|
|
- dpkg --configure --force-hold <package>
|
|
|
-
|
|
|
-If you do this and it fails for some packages they are broken anyway, in
|
|
|
-which case you probably don't have that much to lose by going ahead
|
|
|
-with the upgrade.
|
|
|
-
|
|
|
-Type \"yes\" to confirm that you really want to do the upgrade in
|
|
|
-spite of my warning above; if you give any other response we'll back
|
|
|
-off the upgrade to give you a chance to fix things.
|
|
|
-
|
|
|
-Continue with upgrade despite probable loss of config data ? "
|
|
|
-
|
|
|
- read response
|
|
|
- case "$response" in
|
|
|
- [Yy][Ee][Ss])
|
|
|
- echo "OK, going ahead."
|
|
|
- ;;
|
|
|
- *)
|
|
|
- echo "Aborting dpkg upgrade."
|
|
|
- exit 1
|
|
|
- ;;
|
|
|
- esac
|
|
|
- fi
|
|
|
-
|
|
|
- rm -f $tempfile
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-# Confirm that the user isn't upgrading anything else at the same time
|
|
|
-confirm_singleton() {
|
|
|
- echo -n "
|
|
|
-IMPORTANT - you must install this upgrade on its own, not together in
|
|
|
-the same dpkg run as any other packages. Otherwise you risk losing
|
|
|
-configuration information.
|
|
|
-
|
|
|
-If you say \"no\" to the question below we'll back off the upgrade now,
|
|
|
-and you can then do it later using:
|
|
|
- dpkg --install dpkg-0.93.51.deb
|
|
|
-
|
|
|
-If you're not sure what to do, say \"no\", and then run that command
|
|
|
-(with the appropriate dpkg-*.deb filename) from a root shell prompt.
|
|
|
-
|
|
|
-Are you installing only the dpkg upgrade in this dpkg run ? [y/n] "
|
|
|
- read response
|
|
|
- case "$response" in
|
|
|
- [yY]*|"")
|
|
|
- echo "OK, going ahead."
|
|
|
- ;;
|
|
|
- *)
|
|
|
- echo "Aborting dpkg upgrade."
|
|
|
- exit 1
|
|
|
- ;;
|
|
|
- esac
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-# Confirm that dselect got split into it's own package
|
|
|
-confirm_dselect_split() {
|
|
|
- if [ -x /bin/ps ]; then
|
|
|
- if ! ps -C dselect >/dev/null; then
|
|
|
- return
|
|
|
- fi
|
|
|
- fi
|
|
|
-
|
|
|
- if ! grep "^Package: *dselect$" /var/lib/dpkg/status >/dev/null; then
|
|
|
- echo -n "
|
|
|
-IMPORTANT - if you are upgrading this package from within dselect you
|
|
|
-_MUST_ install the dselect package first.
|
|
|
-
|
|
|
-The dselect frontend has been split into a separate \`dselect' package,
|
|
|
-which has not yet been unpacked onto your system. Continuing the upgrade
|
|
|
-will mean that dselect will temporarily be removed from your system, if
|
|
|
-this happens within dselect the upgrade will fail.
|
|
|
-
|
|
|
-Type \"yes\" to confirm that you really want to do the upgrade in
|
|
|
-spite of my warning above (because you're not running dselect, for
|
|
|
-example); if you give any other response we'll back off the upgrade to
|
|
|
-give you a change to install the dselect package first.
|
|
|
-
|
|
|
-Continue with upgrade despite separation of dselect ? "
|
|
|
-
|
|
|
- read response
|
|
|
- case "$response" in
|
|
|
- [Yy][Ee][Ss])
|
|
|
- echo "OK, going ahead."
|
|
|
- ;;
|
|
|
- *)
|
|
|
- echo "Aborting dpkg upgrade."
|
|
|
- exit 1
|
|
|
- ;;
|
|
|
- esac
|
|
|
- fi
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-# Remove obsolete hd method scripts
|
|
|
-remove_hd_method() {
|
|
|
- methoddir=/usr/lib/dpkg/methods/hd
|
|
|
-
|
|
|
- if [ -d $methoddir ]; then
|
|
|
- echo "Removing obsolete $methoddir ..."
|
|
|
- rm -r $methoddir
|
|
|
- fi
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
# Handle upgrades from pre-conffile dpkg.cfg
|
|
|
upgrade_dpkg_non_conffile()
|
|
|
{
|
|
|
@@ -161,23 +32,6 @@ case "$1" in
|
|
|
;;
|
|
|
|
|
|
upgrade)
|
|
|
- case "$2" in
|
|
|
- # Upgrade from non-C dpkg (pre-0.93.50)
|
|
|
- 0.93.[01234]* | -)
|
|
|
- echo ""
|
|
|
- echo "Contemplating upgrade of dpkg from pre-0.93.50 version ..."
|
|
|
-
|
|
|
- confirm_conffile_stomp
|
|
|
- confirm_singleton
|
|
|
- confirm_dselect_split
|
|
|
- remove_hd_method
|
|
|
- ;;
|
|
|
-
|
|
|
- # Upgrade from pre-dselect split
|
|
|
- 0.93.[5678][0-9]* | 1.[023456789]* | 1.1.* | 1.10 | 1.10.[12] )
|
|
|
- confirm_dselect_split
|
|
|
- ;;
|
|
|
- esac
|
|
|
case "$2" in
|
|
|
# Upgrade from pre-conffile dpkg.cfg
|
|
|
1.9.21 | 1.10.* )
|