[debhelper-devel] [debhelper] 01/01: dh_installsystemd: Fix incorrect error for "missing" files
Niels Thykier
nthykier at moszumanska.debian.org
Sat Nov 4 16:08:14 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 43056e7085fe76ead12ca374063483cf6ed0a7e1
Author: Niels Thykier <niels at thykier.net>
Date: Sat Nov 4 16:05:17 2017 +0000
dh_installsystemd: Fix incorrect error for "missing" files
Signed-off-by: Niels Thykier <niels at thykier.net>
---
debian/changelog | 2 ++
dh_installsystemd | 16 ++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 56b8d9c..b5d8c1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,6 +26,8 @@ debhelper (10.10.6) UNRELEASED; urgency=medium
* dh_install: Fix regression where it was no longer possible to
exclude an entire pattern / source file. Thanks to James Cowgill
for the report. (Closes: #814856)
+ * dh_installsystemd: Permit missing explicitly requested file in
+ package as long as another on being acted on ships it.
-- Axel Beckert <abe at debian.org> Fri, 27 Oct 2017 23:48:44 +0200
diff --git a/dh_installsystemd b/dh_installsystemd
index 8cd826b..2ab6dfb 100755
--- a/dh_installsystemd
+++ b/dh_installsystemd
@@ -209,6 +209,9 @@ sub extract_key {
# PROMISE: DH NOOP WITHOUT tmp(lib/systemd/system) mount path service socket target tmpfile timer
+my %requested_files = map { basename($_) => 1 } @ARGV;
+my %installed_files;
+
foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmpdir = tmpdir($package);
my (@installed_units, @start_units, @enable_units, %aliases, @tmpfiles);
@@ -293,6 +296,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
}
+ $installed_files{$base} = 1 if exists($requested_files{$base});
+
# Skip template service files like e.g. getty at .service.
# Enabling, disabling, starting or stopping those services
# without specifying the instance (e.g. getty at ttyS0.service) is
@@ -384,6 +389,17 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
}
+if (%requested_files) {
+ my $any_missing = 0;
+ for my $name (sort(keys(%requested_files))) {
+ if (not exists($installed_files{$name})) {
+ warning(qq{Requested unit "$name" but it was not found in any package acted on.});
+ $any_missing = 1;
+ }
+ }
+ error("Could not handle all of the requested services") if $any_missing;
+}
+
=head1 SEE ALSO
L<debhelper(7)>
--
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