]> asedeno.scripts.mit.edu Git - 1ts-debian.git/commitdiff
clean obsolete conffiles
authorkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Wed, 2 Sep 2009 18:05:38 +0000 (18:05 +0000)
committerkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Wed, 2 Sep 2009 18:05:38 +0000 (18:05 +0000)
git-svn-id: svn://svn.1ts.org/debian/trunk@501 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f

zephyr/debian/changelog
zephyr/debian/zephyr-clients.preinst [new file with mode: 0644]

index 0dfc25b9047c7e7d9bd3f533fc3294a84daf6eec..af59b8a615f00d4ba51f762db0919c6efb564840 100644 (file)
@@ -1,7 +1,8 @@
 zephyr (3.0~rc.2544-1) notyet; urgency=low
 
   * New upstream.
-
+  * GC obsolete conffiles; Closes: #538028
+  
  -- Karl Ramm <kcr@1ts.org>  Thu, 27 Aug 2009 14:50:04 -0400
 
 zephyr (3.0~beta.2483-2) unstable; urgency=low
diff --git a/zephyr/debian/zephyr-clients.preinst b/zephyr/debian/zephyr-clients.preinst
new file mode 100644 (file)
index 0000000..e3d9880
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+# Grabbed from http://wiki.debian.org/DpkgConffileHandling 20090902
+# Remove a no-longer used conffile
+rm_conffile() {
+    local PKGNAME="$1"
+    local CONFFILE="$2"
+
+    [ -e "$CONFFILE" ] || return 0
+
+    local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
+    local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \
+            sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
+    if [ "$md5sum" != "$old_md5sum" ]; then
+        echo "Obsolete conffile $CONFFILE has been modified by you."
+        echo "Saving as $CONFFILE.dpkg-bak ..."
+        mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
+    else
+        echo "Removing obsolete conffile $CONFFILE ..."
+        rm -f "$CONFFILE"
+    fi
+}
+
+case "$1" in
+install|upgrade)
+    if dpkg --compare-versions "$2" le "3.0~beta.2483-2"; then
+        rm_conffile mypackage "/etc/zephyr/xzwrite.bitmap"
+        rm_conffile mypackage "/etc/zpehyr/XZwrite"
+    fi
+esac
+
+#DEBHELPER#
+
+exit 0