[debhelper-devel] [debhelper] 02/03: autoscripts/*systemd*: Consistently use "|| true"

Niels Thykier nthykier at moszumanska.debian.org
Mon Jan 1 08:39:22 UTC 2018


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 8a9db97be30865edc260549fad22ac787cf7293a
Author: Niels Thykier <niels at thykier.net>
Date:   Mon Jan 1 08:35:36 2018 +0000

    autoscripts/*systemd*: Consistently use "|| true"
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 autoscripts/postrm-systemd        | 6 +++---
 autoscripts/prerm-systemd         | 2 +-
 autoscripts/prerm-systemd-restart | 2 +-
 debian/changelog                  | 4 ++++
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/autoscripts/postrm-systemd b/autoscripts/postrm-systemd
index 22725ce..d95013b 100644
--- a/autoscripts/postrm-systemd
+++ b/autoscripts/postrm-systemd
@@ -1,12 +1,12 @@
 if [ "$1" = "remove" ]; then
 	if [ -x "/usr/bin/deb-systemd-helper" ]; then
-		deb-systemd-helper mask #UNITFILES# >/dev/null
+		deb-systemd-helper mask #UNITFILES# >/dev/null || true
 	fi
 fi
 
 if [ "$1" = "purge" ]; then
 	if [ -x "/usr/bin/deb-systemd-helper" ]; then
-		deb-systemd-helper purge #UNITFILES# >/dev/null
-		deb-systemd-helper unmask #UNITFILES# >/dev/null
+		deb-systemd-helper purge #UNITFILES# >/dev/null || true
+		deb-systemd-helper unmask #UNITFILES# >/dev/null || true
 	fi
 fi
diff --git a/autoscripts/prerm-systemd b/autoscripts/prerm-systemd
index 6cc7242..d85223f 100644
--- a/autoscripts/prerm-systemd
+++ b/autoscripts/prerm-systemd
@@ -1,3 +1,3 @@
 if [ -d /run/systemd/system ]; then
-	deb-systemd-invoke stop #UNITFILES# >/dev/null
+	deb-systemd-invoke stop #UNITFILES# >/dev/null || true
 fi
diff --git a/autoscripts/prerm-systemd-restart b/autoscripts/prerm-systemd-restart
index 51abb0b..13b0388 100644
--- a/autoscripts/prerm-systemd-restart
+++ b/autoscripts/prerm-systemd-restart
@@ -1,3 +1,3 @@
 if [ -d /run/systemd/system ] && [ "$1" = remove ]; then
-	deb-systemd-invoke stop #UNITFILES# >/dev/null
+	deb-systemd-invoke stop #UNITFILES# >/dev/null || true
 fi
diff --git a/debian/changelog b/debian/changelog
index 6ec3bf6..1618c90 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -39,6 +39,10 @@ debhelper (11.1) UNRELEASED; urgency=medium
   * Dh_Lib.pm: Make "exit 1" the default error-handler instead of
     "exit $?" as this makes it easier to migrate from sed-based
     autoscript substitutions to the new hash-based ones.
+  * autoscripts/*systemd*: Also use "|| true" in removal scripts for
+    systemd related tools if we do it in other scripts for the same
+    command.  Thanks to Laurent Bigonville for the report.
+    (Closes: #761272)
 
  -- Niels Thykier <niels at thykier.net>  Sun, 17 Dec 2017 07:59:18 +0000
 

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




More information about the debhelper-devel mailing list