r18284 - in /desktop/experimental/gnome-power-manager/debian: changelog preinst

joss at users.alioth.debian.org joss at users.alioth.debian.org
Sat Jan 24 09:17:00 UTC 2009


Author: joss
Date: Sat Jan 24 09:17:00 2009
New Revision: 18284

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=18284
Log:
preinst: remove the obsolete conffile. Closes: #511050.

Added:
    desktop/experimental/gnome-power-manager/debian/preinst
Modified:
    desktop/experimental/gnome-power-manager/debian/changelog

Modified: desktop/experimental/gnome-power-manager/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-power-manager/debian/changelog?rev=18284&op=diff
==============================================================================
--- desktop/experimental/gnome-power-manager/debian/changelog (original)
+++ desktop/experimental/gnome-power-manager/debian/changelog Sat Jan 24 09:17:00 2009
@@ -10,6 +10,7 @@
     GStreamer does funny things that will confuse the Sparc compiler 
     while there is actually no loss of alignment. Closes: #510397.
   * 70_relibtoolize.patch: regenerated.
+  * preinst: remove the obsolete conffile. Closes: #511050.
 
  -- Sam Morris <sam at robots.org.uk>  Sat, 03 Jan 2009 00:44:27 +0000
 

Added: desktop/experimental/gnome-power-manager/debian/preinst
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/gnome-power-manager/debian/preinst?rev=18284&op=file
==============================================================================
--- desktop/experimental/gnome-power-manager/debian/preinst (added)
+++ desktop/experimental/gnome-power-manager/debian/preinst Sat Jan 24 09:17:00 2009
@@ -1,0 +1,29 @@
+#! /bin/sh
+set -e
+
+# Remove a no-longer used conffile
+rm_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
+            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
+    fi
+}
+
+case "$1" in
+install|upgrade)
+    if dpkg --compare-versions "$2" lt 2.24.2-3; then
+        rm_conffile mypackage /etc/dbus-1/system.d/gnome-power-manager.conf
+    fi
+esac
+
+#DEBHELPER#




More information about the pkg-gnome-commits mailing list