[Debpool-commits] [SCM] Debpool Project Repository branch, master, updated. debian/0.3.6-10-gbef53a0

Andres Mejia mcitadel at gmail.com
Fri Oct 17 17:02:02 UTC 2008


The following commit has been merged in the master branch:
commit bef53a01e97063cdec2783c0a91e427b3fcd90e3
Author: Andres Mejia <mcitadel at gmail.com>
Date:   Fri Oct 17 13:01:51 2008 -0400

      * Handle conffile renaming as suggested in
        http://wiki.debian.org/DpkgConffileHandling.

diff --git a/debian/changelog b/debian/changelog
index 7c10f61..0380223 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+debpool (0.3.10) experimental; urgency=low
+
+  * Handle conffile renaming as suggested in
+    http://wiki.debian.org/DpkgConffileHandling.
+
+ -- Andres Mejia <mcitadel at gmail.com>  Fri, 17 Oct 2008 12:50:08 -0400
+
 debpool (0.3.9) experimental; urgency=low
 
   * Allow binNMUs.
diff --git a/debian/debpool.postinst b/debian/debpool.postinst
new file mode 100644
index 0000000..bab3a97
--- /dev/null
+++ b/debian/debpool.postinst
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# Handle our conffile renaming
+
+# Move a conffile without triggering a dpkg question
+mv_conffile() {
+    OLDCONFFILE="$1"
+    NEWCONFFILE="$2"
+    if [ -e "$OLDCONFFILE" ]; then
+        echo "Preserving user changes to $NEWCONFFILE ..."
+        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
+        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
+    fi
+}
+
+case "$1" in
+configure)
+    if dpkg --compare-versions "$2" le "0.3.8"; then
+        mv_conffile "/etc/debpool/Config.pm" "/etc/debpool/debpoolrc"
+    fi
+esac
+
+#DEBHELPER#
diff --git a/debian/debpool.preinst b/debian/debpool.preinst
new file mode 100644
index 0000000..2270bdb
--- /dev/null
+++ b/debian/debpool.preinst
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+
+# Handle our conffile renaming.
+
+# Prepare to move a conffile without triggering a dpkg question
+prep_mv_conffile() {
+    PKGNAME="$1"
+    CONFFILE="$2"
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
+        if [ "$md5sum" = "$old_md5sum" ]; then
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
+case "$1" in
+install|upgrade)
+    if dpkg --compare-versions "$2" le "0.3.8"; then
+        prep_mv_conffile "debpool" "/etc/debpool/Config.pm"
+    fi
+esac
+
+#DEBHELPER#

-- 
Debpool Project Repository



More information about the Debpool-commits mailing list