From: kcr Date: Wed, 2 Sep 2009 18:05:38 +0000 (+0000) Subject: clean obsolete conffiles X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=1c1641f1721bcd2218ed4b5651b5b6b319d46399;p=1ts-debian.git clean obsolete conffiles git-svn-id: svn://svn.1ts.org/debian/trunk@501 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f --- diff --git a/zephyr/debian/changelog b/zephyr/debian/changelog index 0dfc25b..af59b8a 100644 --- a/zephyr/debian/changelog +++ b/zephyr/debian/changelog @@ -1,7 +1,8 @@ zephyr (3.0~rc.2544-1) notyet; urgency=low * New upstream. - + * GC obsolete conffiles; Closes: #538028 + -- Karl Ramm 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 index 0000000..e3d9880 --- /dev/null +++ b/zephyr/debian/zephyr-clients.preinst @@ -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