[Pkg-cracklib-commits] [SCM] Git repository for pkg-cracklib branch, master, updated. debian/2.8.15-7-2-gc537fed

Jan Dittberner jandd at debian.org
Thu Feb 4 16:47:42 UTC 2010


The following commit has been merged in the master branch:
commit 68950f9dd93e003bf4bbda41826a71ba8f01d81e
Author: Jan Dittberner <jandd at debian.org>
Date:   Thu Feb 4 16:38:51 2010 +0100

    remove old logcheck conffiles

diff --git a/debian/changelog b/debian/changelog
index 2939c4e..f833d44 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+cracklib2 (2.8.15-8) UNRELEASED; urgency=low
+
+  * remove old logcheck ignore.d.{workstation,server} conffiles in
+    preinst script (thanks for the hint to Hannes von Haugwitz)
+
+ -- Jan Dittberner <jandd at debian.org>  Thu, 04 Feb 2010 16:37:31 +0100
+
 cracklib2 (2.8.15-7) unstable; urgency=low
 
   * remove debian/cracklib-runtime.logcheck.ignore.{server,workstation}
diff --git a/debian/cracklib-runtime.preinst b/debian/cracklib-runtime.preinst
index b9d6e19..7e37f2f 100644
--- a/debian/cracklib-runtime.preinst
+++ b/debian/cracklib-runtime.preinst
@@ -2,18 +2,37 @@
 
 set -e
 
+# 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)
     # /etc/cron.daily/cracklib -> cracklib-runtime transition
     if dpkg --compare-versions "$2" le "2.7-17"; then
-	  CONFFILE=/etc/cron.daily/cracklib
-	  if [ -e "$CONFFILE" ]; then
-	    md5sum="`md5sum \"$CONFFILE\" | sed -e 's/ .*//'`"
-	    old_md5sum="`dpkg-query -W -f='${Conffiles}' cracklib-runtime|sed -n -e \"{\\\\' $CONFFILE'{s/.* //;p}}\"`"
-	    if [ "$md5sum" = "$old_md5sum" ]; then
-		  rm -f "$CONFFILE"
-	    fi
-      fi
+        rm_conffile cracklib-runtime "/etc/cron.daily/cracklib"
+    fi
+    # /etc/logcheck/ignore.d.{server,workstation}/cracklib-runtime removal
+    if dpkg --compare-versions "$2" le "2.8.15-7"; then
+        rm_conffile cracklib-runtime "/etc/logrotate/ignore.d.server/cracklib-runtime"
+        rm_conffile cracklib-runtime "/etc/logrotate/ignore.d.workstation/cracklib-runtime"
     fi
 esac
 

-- 
Git repository for pkg-cracklib



More information about the Pkg-cracklib-commits mailing list