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

Yves-Alexis Perez corsac at alioth.debian.org
Mon Apr 11 01:58:39 UTC 2011


Author: corsac
Date: 2011-04-11 13:58:39 +0000 (Mon, 11 Apr 2011)
New Revision: 5364

Modified:
   desktop/trunk/xfce4-utils/debian/postinst
   desktop/trunk/xfce4-utils/debian/postrm
   desktop/trunk/xfce4-utils/debian/preinst
Log:
do the conffile removal using dpkg-maintscript-helper


Modified: desktop/trunk/xfce4-utils/debian/postinst
===================================================================
--- desktop/trunk/xfce4-utils/debian/postinst	2011-04-11 13:57:15 UTC (rev 5363)
+++ desktop/trunk/xfce4-utils/debian/postinst	2011-04-11 13:58:39 UTC (rev 5364)
@@ -7,6 +7,11 @@
     x-session-manager.1.gz /usr/share/man/man1/startxfce4.1.gz
 fi
 
+if dpkg-maintscript-helper supports rm_conffile; then
+  dpkg-maintscript-helper rm_conffile \
+  /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
+fi
+
 #DEBHELPER#
 
 exit 0

Modified: desktop/trunk/xfce4-utils/debian/postrm
===================================================================
--- desktop/trunk/xfce4-utils/debian/postrm	2011-04-11 13:57:15 UTC (rev 5363)
+++ desktop/trunk/xfce4-utils/debian/postrm	2011-04-11 13:58:39 UTC (rev 5364)
@@ -1,6 +1,11 @@
 #!/bin/sh
 set -e
 
+if dpkg-maintscript-helper supports rm_conffile; then
+  dpkg-maintscript-helper rm_conffile \
+  /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
+fi
+
 if [ "$1" = "purge" ]; then
 	rm -f /etc/dm/Sessions/xfce4.desktop
 fi

Modified: desktop/trunk/xfce4-utils/debian/preinst
===================================================================
--- desktop/trunk/xfce4-utils/debian/preinst	2011-04-11 13:57:15 UTC (rev 5363)
+++ desktop/trunk/xfce4-utils/debian/preinst	2011-04-11 13:58:39 UTC (rev 5364)
@@ -1,25 +1,5 @@
 #!/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
@@ -28,11 +8,13 @@
 		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
 
+if dpkg-maintscript-helper supports rm_conffile; then
+  dpkg-maintscript-helper rm_conffile \
+  /etc/xdg/autostart/xfconf-migration-4.6.desktop "4.8.1-1" -- "$@"
+fi
+
 #DEBHELPER#
 
 exit 0




More information about the Pkg-xfce-commits mailing list