[debhelper-devel] [debhelper] 01/02: Revert "dh_installsystemd: Avoid invalid scripts when there are no units"

Niels Thykier nthykier at moszumanska.debian.org
Fri Nov 10 06:21:09 UTC 2017


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

nthykier pushed a commit to branch master
in repository debhelper.

commit ddc78783969270bb7b95beb233314180bfda2521
Author: Niels Thykier <niels at thykier.net>
Date:   Fri Nov 10 06:17:30 2017 +0000

    Revert "dh_installsystemd: Avoid invalid scripts when there are no units"
    
    This reverts commit 86d05e41e4549ca01aa27ebf12f68da84b2d45fd.
---
 debian/changelog  |  4 ----
 dh_installsystemd | 21 +++++++++------------
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 684732a..6320679 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,10 +31,6 @@ debhelper (10.10.6) UNRELEASED; urgency=medium
     package as long as another on being acted on ships it.
   * dh_installsystemd: Optimize the search for files installed in the
     tmpfiles.d directories to only look in the tmpfiles.d directories.
-  * dh_installsystemd: Fix a bug where dh_installsystemd would generate
-    invalid maintscript, when there were no units to start or enable.
-    Thanks to Ben Hutchings and Bastian Blank for the bug report.
-    (Closes: #881190)
 
  -- Axel Beckert <abe at debian.org>  Fri, 27 Oct 2017 23:48:44 +0200
 
diff --git a/dh_installsystemd b/dh_installsystemd
index ebe25a3..671fb48 100755
--- a/dh_installsystemd
+++ b/dh_installsystemd
@@ -349,20 +349,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
 	next if @start_units == 0 && @enable_units == 0;
 
-	if (@enable_units) {
-		for my $unit (sort @enable_units) {
-			my $base = q{'} . basename($unit) . q{'};
-			if ($dh{NO_ENABLE}) {
-				autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base });
-			} else {
-				autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base });
-			}
+	for my $unit (sort @enable_units) {
+		my $base = q{'} . basename($unit) . q{'};
+		if ($dh{NO_ENABLE}) {
+			autoscript($package, 'postinst', 'postinst-systemd-dont-enable', { 'UNITFILE' => $base });
+		} else {
+			autoscript($package, 'postinst', 'postinst-systemd-enable', { 'UNITFILE' => $base });
 		}
-		my $enableunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @enable_units);
-		autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $enableunitargs });
 	}
-
-	next if not @start_units;
+	my $enableunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @enable_units);
+	autoscript($package, 'postrm', 'postrm-systemd', {'UNITFILES' => $enableunitargs });
+	
 	# The $package and $sed parameters are always the same.
 	# This wrapper function makes the following logic easier to read.
 	my $startunitargs = join(' ', sort map { q{'} . basename($_) . q{'} } @start_units);

-- 
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