From 7f9694fc967472909983fac011f13641187e2757 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 4 Jul 2007 12:32:36 +0200 Subject: [PATCH] debian/preinst: fix maintainer-script-uses-dpkg-status-directly --- debian/changelog | 4 ++++ debian/preinst | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5a5a95a..fd48ce0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ grml-etc (1.0.11) unstable; urgency=low * /etc/init.d/grml-reboot: cosmetic fix (drop an empty line of output which seems unnecessary nowadays) + * debian/preinst: change /var/lib/dpkg/status code to the usual + dpkg-query solution (as http://wiki.debian.org/DpkgConffileHandling + suggests) to make lintian happy + (hello maintainer-script-uses-dpkg-status-directly). -- Michael Prokop Sun, 01 Jul 2007 20:21:45 +0200 diff --git a/debian/preinst b/debian/preinst index 615ed55..da3ff00 100755 --- a/debian/preinst +++ b/debian/preinst @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Don Nov 02 20:58:57 CET 2006 [mika] +# Latest change: Mit Jul 04 12:31:26 CEST 2007 [mika] ################################################################################ set -e @@ -28,9 +28,10 @@ rm_conffile() { if [ -e "$CONFFILE" ]; then md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" - old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' grml-etc | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" if [ "$md5sum" != "$old_md5sum" ]; then - echo "Conffile $CONFFILE has been modified, temporary moving to $CONFFILE.dpkg-bak ..." + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." mv -f "$CONFFILE" "$CONFFILE".dpkg-bak fi fi -- 2.1.4