[SCM] "Network Management" Plasma widget Debian packaging branch, experimental, updated. debian/0.9.0.8-1-2-gb4aaee0

Michael Biebl biebl at alioth.debian.org
Thu Mar 28 18:00:33 UTC 2013


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/networkmanagement.git;a=commitdiff;h=50515e6

The following commit has been merged in the experimental branch:
commit 50515e6df53587d840eabd19b8fdb2213f3d6fbe
Author: Michael Biebl <biebl at debian.org>
Date:   Thu Mar 28 11:30:13 2013 +0100

    Remove obsolete D-Bus policy conffile on upgrades. (Closes: #704086)
---
 debian/changelog                               |    6 +++
 debian/plasma-widget-networkmanagement.preinst |   41 ++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d4aba65..89025f3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+networkmanagement (0.9.0.8-2) UNRELEASED; urgency=low
+
+  * Remove obsolete D-Bus policy conffile on upgrades. (Closes: #704086)
+
+ -- Michael Biebl <biebl at debian.org>  Wed, 27 Mar 2013 20:03:01 +0100
+
 networkmanagement (0.9.0.8-1) experimental; urgency=low
 
   * New upstream release.
diff --git a/debian/plasma-widget-networkmanagement.preinst b/debian/plasma-widget-networkmanagement.preinst
new file mode 100644
index 0000000..8d02e8d
--- /dev/null
+++ b/debian/plasma-widget-networkmanagement.preinst
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+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 }")"
+
+    # Do nothing if conffile is not registered for that package.
+    # This behaviour is different from what dpkg-maintscript-helper is doing
+    # on rm_conffile. We do this to correctly handle the case where
+    # the conffile was moved from one package to another via Replaces.
+    [ -n "$old_md5sum" ] || return 0
+
+    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" = upgrade ] && dpkg --compare-versions "$2" lt-nl "0.9.0.8-2"  ; then
+    # The conffile was moved from knm-runtime to p-n-m during
+    # development of wheezy so we need some special handling of this case
+    rm_conffile plasma-widget-networkmanagement "/etc/dbus-1/system.d/NetworkManager-kde4.conf"
+    rm_conffile knm-runtime "/etc/dbus-1/system.d/NetworkManager-kde4.conf"
+fi
+
+#DEBHELPER#
+
+exit 0

-- 
"Network Management" Plasma widget Debian packaging



More information about the pkg-kde-commits mailing list