[Pkg-samba-maint] [samba] 01/01: Check for alternative's presence before calling update-alternatives --remove-all, instead of silently ignoring all errors from update-alternatives.

Steve Langasek vorlon at moszumanska.debian.org
Mon Dec 9 19:14:44 UTC 2013


This is an automated email from the git hooks/post-receive script.

vorlon pushed a commit to branch master
in repository samba.

commit 2810d995b5e38e9227e64466cf4bcfc31b2e490a
Author: Steve Langasek <vorlon at debian.org>
Date:   Mon Dec 9 11:14:32 2013 -0800

    Check for alternative's presence before calling update-alternatives --remove-all, instead of silently ignoring all errors from update-alternatives.
---
 debian/changelog                 | 8 ++++++++
 debian/samba-common-bin.postinst | 9 ++++++---
 debian/samba.postinst            | 4 +++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index daa33a2..b33ec0b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+samba (2:4.0.13+dfsg-2) UNRELEASED; urgency=low
+
+  * Check for alternative's presence before calling update-alternatives
+    --remove-all, instead of silently ignoring all errors from
+    update-alternatives.
+
+ -- Steve Langasek <vorlon at debian.org>  Mon, 09 Dec 2013 11:13:59 -0800
+
 samba (2:4.0.13+dfsg-1) unstable; urgency=high
 
   [ Steve Langasek ]
diff --git a/debian/samba-common-bin.postinst b/debian/samba-common-bin.postinst
index 786a8ea..7b8c3be 100644
--- a/debian/samba-common-bin.postinst
+++ b/debian/samba-common-bin.postinst
@@ -3,9 +3,12 @@
 set -e 
 
 if dpkg --compare-versions "$2" lt-nl 2:4.0.12+dfsg-2~; then
-	update-alternatives --remove-all nmblookup || true
-	update-alternatives --remove-all net || true
-	update-alternatives --remove-all testparm || true
+	for alternative in nmblookup net testparm; do
+		if update-alternatives --list $alternative >/dev/null 2>&1
+		then
+			update-alternatives --remove-all $alternative
+		fi
+	done
 fi
 
 #DEBHELPER#
diff --git a/debian/samba.postinst b/debian/samba.postinst
index 267e530..a44ac09 100644
--- a/debian/samba.postinst
+++ b/debian/samba.postinst
@@ -40,7 +40,9 @@ if dpkg --compare-versions "$2" lt-nl 2:3.6.15-2; then
 fi
 
 if dpkg --compare-versions "$2" lt-nl 2:4.0.12+dfsg-2~; then
-	update-alternatives --remove-all smbstatus || true
+	if update-alternatives --list smbstatus >/dev/null 2>&1; then
+		update-alternatives --remove-all smbstatus
+	fi
 fi
 
 # add the sambashare group

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git




More information about the Pkg-samba-maint mailing list