[Pkg-xfce-commits] r5353 - desktop/trunk/xfce4-utils/debian

Lionel Le Folgoc mrpouit-guest at alioth.debian.org
Wed Apr 6 07:44:38 UTC 2011


Author: mrpouit-guest
Date: 2011-04-06 19:44:37 +0000 (Wed, 06 Apr 2011)
New Revision: 5353

Modified:
   desktop/trunk/xfce4-utils/debian/changelog
   desktop/trunk/xfce4-utils/debian/preinst
Log:
debian/preinst: Clean up migration script on upgrade.

Modified: desktop/trunk/xfce4-utils/debian/changelog
===================================================================
--- desktop/trunk/xfce4-utils/debian/changelog	2011-04-06 18:23:06 UTC (rev 5352)
+++ desktop/trunk/xfce4-utils/debian/changelog	2011-04-06 19:44:37 UTC (rev 5353)
@@ -9,6 +9,7 @@
     - remove Emanuele and Simon from uploaders, thanks to them.
     - remove libxml-parser-perl dependency since we no disable the perl
       migration script.
+  * debian/preinst: Clean up migration script on upgrade.
 
  -- Yves-Alexis Perez <corsac at debian.org>  Wed, 06 Apr 2011 10:42:08 +0200
 

Modified: desktop/trunk/xfce4-utils/debian/preinst
===================================================================
--- desktop/trunk/xfce4-utils/debian/preinst	2011-04-06 18:23:06 UTC (rev 5352)
+++ desktop/trunk/xfce4-utils/debian/preinst	2011-04-06 19:44:37 UTC (rev 5353)
@@ -1,5 +1,25 @@
 #!/bin/sh -e
 
+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
+}
+
+
 if [ "$1" = "install" -o "$1" = "upgrade" ]; then
 	# Move the old config files before dpkg checks them.
 	if [ -d /etc/X11/xdg/xfce4 ]; then
@@ -7,6 +27,10 @@
 		mv /etc/X11/xdg/xfce4/* /etc/xdg/xfce4 || true
 		rmdir /etc/X11/xdg/xfce4 || true
 	fi
+
+	if dpkg --compare-versions "$2" lt-nl "4.8.1-2"; then
+	    rm_conffile xfce4-utils /etc/xdg/autostart/xfconf-migration-4.6.desktop
+	fi
 fi
 
 #DEBHELPER#




More information about the Pkg-xfce-commits mailing list