From 29ea95a5c289b830c7a42f521af99d250c6fcfe9 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 18 Jun 2013 22:51:11 +0200 Subject: dh_installinit: use absolute path to tmpfiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While newer systemd versions don’t need the absolute path, this breaks with older systemd versions, notably v44, which we currently have in wheezy. Using the absolute paths has no drawbacks and works with both versions. --- dh_installinit | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'dh_installinit') diff --git a/dh_installinit b/dh_installinit index 4b6702d8..7ee16ef0 100755 --- a/dh_installinit +++ b/dh_installinit @@ -266,17 +266,19 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my @tmpfiles; find({ wanted => sub { - return unless -f $File::Find::name; - if ($File::Find::name =~ m,^$tmpdir/usr/lib/tmpfiles\.d/, || - $File::Find::name =~ m,^$tmpdir/etc/tmpfiles\.d/,) { - push @tmpfiles, $File::Find::name; + my $name = $File::Find::name; + return unless -f $name; + $name =~ s/^$tmpdir//g; + if ($name =~ m,^/usr/lib/tmpfiles\.d/, || + $name =~ m,^/etc/tmpfiles\.d/,) { + push @tmpfiles, $name; } }, no_chdir => 1, }, $tmpdir); if (@tmpfiles > 0) { autoscript($package,"postinst", "postinst-init-tmpfiles", - "s/#TMPFILES#/" . join(" ", map { basename($_) } @tmpfiles)."/"); + "s,#TMPFILES#," . join(" ", @tmpfiles).","); } if (! $dh{NO_START}) { -- cgit v1.2.3