[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#779668: (pre-approval) unblock: samba/2:4.1.17+dfsg-2



Followup-For: Bug #779668
Control: retitle -1 (pre-approval) unblock: samba/2:4.1.17+dfsg-2

OK, let's try to work around it in samba then ...

Andreas
>From 0686613cbce92aadb4893508a8a215c0acc2e2aa Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Wed, 4 Mar 2015 13:27:33 +0100
Subject: [PATCH] work around qtsmbdstatus-server releated upgrade problems

---
 debian/changelog     |  9 +++++++++
 debian/samba.preinst | 18 ++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 debian/samba.preinst

diff --git a/debian/changelog b/debian/changelog
index 40abb9c..b44ce23 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+samba (2:4.1.17+dfsg-2) UNRELEASED; urgency=medium
+
+  * Add samba.preinst to temporarily deactivate the old qtsmbstatusd
+    initscript which has dependencies incompatible with the new samba
+    initscript. This will ensure a clean upgrade path for samba if the
+    qtsmbstatus-server package was installed previously.  (Closes: #779666)
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 04 Mar 2015 12:12:57 +0100
+
 samba (2:4.1.17+dfsg-1) unstable; urgency=high
 
   * New upstream release. Fixes:
diff --git a/debian/samba.preinst b/debian/samba.preinst
new file mode 100644
index 0000000..ae8cfaa
--- /dev/null
+++ b/debian/samba.preinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+# Deactivate the old qtsmbstatusd initscript that has dependencies
+# incompatible with the new samba initscript. This will allow to
+# configure the new samba package and qtsmbstatus-server afterwards.
+if [ "$1" = "upgrade" ] || [ "$1" = "install" ]; then
+	if [ -x "/etc/init.d/qtsmbstatusd" ]; then
+		version=$(dpkg-query -f '${Config-Version} ${Version}' -W qtsmbstatus-server 2>/dev/null | awk '{ print $1 }')
+		if dpkg --compare-versions "$version" lt-nl "2.2.1-3~" ; then
+			echo "Deactivating qtsmbstatusd temporarily..."
+			invoke-rc.d qtsmbstatusd stop
+			update-rc.d -f qtsmbstatusd remove
+		fi
+	fi
+fi
+
+#DEBHELPER#
-- 
2.1.4


Reply to: