tag 857173 + patch
thanks

Hi,

This patch should do the job, I'll test it tomorrow if nobody beats me.

Cheers,

Laurent Bigonville
diff -Nru irqbalance-1.1.0/debian/changelog irqbalance-1.1.0/debian/changelog
--- irqbalance-1.1.0/debian/changelog	2016-12-31 11:55:09.000000000 +0100
+++ irqbalance-1.1.0/debian/changelog	2017-03-08 23:13:43.000000000 +0100
@@ -1,3 +1,12 @@
+irqbalance (1.1.0-2.3) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix the the reinstallation of the package if was removed but not purged,
+    in that case the preinst script is called with the both the "install" and
+    version parameter, we should consider this as an upgrade (Closes: #857173)
+
+ -- Laurent Bigonville <bi...@debian.org>  Wed, 08 Mar 2017 23:13:43 +0100
+
 irqbalance (1.1.0-2.2) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru irqbalance-1.1.0/debian/irqbalance.preinst irqbalance-1.1.0/debian/irqbalance.preinst
--- irqbalance-1.1.0/debian/irqbalance.preinst	2016-12-21 16:05:03.000000000 +0100
+++ irqbalance-1.1.0/debian/irqbalance.preinst	2017-03-08 23:13:09.000000000 +0100
@@ -8,7 +8,10 @@
 INSTALL_FLAG_FILE=/run/irqbalance.dpkg-install
 
 # tell irqbalance.config if we're upgrading or installing since it can't tell.
-if [ "$1" = "upgrade" ]; then
+# if we are reinstalling the package after it has been removed but not purged
+# we should threat that case as the upgrade case as we need to preserve the
+# service state.
+if [ "$1" = "upgrade" ] || [ "$1" = "install" -a "$2" != "" ]; then
 	touch $UPGRADE_FLAG_FILE
 fi
 if [ "$1" = "install" ]; then
@@ -19,7 +22,7 @@
 # proper conffile needs to be taken into consideration here to avoid
 # blatantly overwriting it on upgrades.
 # (We'll do the actuan conversion in config/postinst.)
-if [ "$1" = "upgrade" ] &&  [ "$2" != "" ] && \
+if [ "$1" = "upgrade" -o "$1" = "install" ] &&  [ "$2" != "" ] && \
 		[ -e /etc/default/irqbalance ] && \
 		dpkg --compare-versions "$2" lt "1.1.0-2.1~"
 then

Reply via email to