]> err.no Git - dpkg/commitdiff
Remove non-modified /etc/dpkg/dpkg.cfg configuration file when upgrading
authorGuillem Jover <guillem@debian.org>
Mon, 1 Jan 2007 22:16:16 +0000 (22:16 +0000)
committerGuillem Jover <guillem@debian.org>
Mon, 1 Jan 2007 22:16:16 +0000 (22:16 +0000)
from versions 1.9.21 through 1.10.28, to avoid getting prompted about
conffile changes. Closes: #398061

debian/changelog
debian/dpkg.preinst

index 32285ace4dfc9fec59b9460a15c9d02c8a6a976c..2ffe24844a9d0bfeb2ae77a86d3112f06e8c5765 100644 (file)
@@ -11,6 +11,9 @@ dpkg (1.13.25~) UNRELEASED; urgency=low
   * Support extracting lzma compressed source and binary packages,
     and add a Suggests on package lzma. Closes: #347715
   * Add '/emul/ia32-linux' biarch paths to dpkg-shlibdeps. Closes: #403216
+  * Remove non-modified /etc/dpkg/dpkg.cfg configuration file when upgrading
+    from versions 1.9.21 through 1.10.28, to avoid getting prompted about
+    conffile changes. Closes: #398061
 
   [ Updated dpkg translations ]
   * Chinese (Traditional, Asho Yeh)
index a5895d41428209cee8c601222b29b3b7ef6414a8..66805b9ec3fda927258e22ab9aaa6a4121b708e7 100755 (executable)
@@ -143,6 +143,19 @@ remove_hd_method() {
 }
 
 
+# Handle upgrades from pre-conffile dpkg.cfg
+upgrade_dpkg_non_conffile()
+{
+    if [ -r /etc/dpkg/dpkg.cfg ]; then
+       dpkg_cfg_md5="535552ad5ee9145dbc7a34c264df4e59  /etc/dpkg/dpkg.cfg"
+       if echo "$dpkg_cfg_md5" | md5sum -c >/dev/null 2>&1; then
+           echo "Removing non-modified dpkg.cfg to be replaced by a conffile ..."
+           rm -f /etc/dpkg/dpkg.cfg
+       fi
+    fi
+}
+
+
 case "$1" in
     install)
        ;;
@@ -165,6 +178,12 @@ case "$1" in
                confirm_dselect_split
                ;;
        esac
+       case "$2" in
+           # Upgrade from pre-conffile dpkg.cfg
+           1.9.21 | 1.10.* )
+               upgrade_dpkg_non_conffile
+               ;;
+       esac
        ;;
 
     abort-upgrade)