[debhelper-devel] [debhelper] 01/01: dh_installsystemd: Optimize the tmpfiles search

Niels Thykier nthykier at moszumanska.debian.org
Sat Nov 4 16:19:36 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 203f573937dcc6353b9c8b054770b1debbf1e7fb
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Nov 4 16:18:21 2017 +0000

    dh_installsystemd: Optimize the tmpfiles search
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog  | 2 ++
 dh_installsystemd | 8 +++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index abf4193..9c228f5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,8 @@ debhelper (10.10.6) UNRELEASED; urgency=medium
     for the report.  (Closes: #814856, LP#1554979)
   * dh_installsystemd: Permit missing explicitly requested file in
     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.
 
  -- Axel Beckert <abe at debian.org>  Fri, 27 Oct 2017 23:48:44 +0200
 
diff --git a/dh_installsystemd b/dh_installsystemd
index 2ab6dfb..671fb48 100755
--- a/dh_installsystemd
+++ b/dh_installsystemd
@@ -332,18 +332,16 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 	# Include postinst-init-tmpfiles if the package ships any files
 	# in /usr/lib/tmpfiles.d or /etc/tmpfiles.d
 	if (-d $tmpdir) {
+		my @dirs = grep { -d } map { "${tmpdir}/$_" } qw(usr/lib/tmpfiles.d etc/tmpfiles.d);
 		find({
 				wanted   => sub {
 					my $name = $File::Find::name;
 					return unless -f $name;
 					$name =~ s/^\Q$tmpdir\E//g;
-					if ($name =~ m,^/usr/lib/tmpfiles\.d/, ||
-						$name =~ m,^/etc/tmpfiles\.d/,) {
-						push @tmpfiles, $name;
-					}
+					push(@tmpfiles, $name);
 				},
 				no_chdir => 1,
-			}, $tmpdir);
+			}, @dirs) if @dirs;
 		if (@tmpfiles > 0) {
 			autoscript($package, 'postinst', 'postinst-init-tmpfiles', { 'TMPFILES' => join(' ', sort @tmpfiles) });
 		}

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