diff options
author | Michael Stapelberg <michael@stapelberg.de> | 2013-06-18 22:51:11 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-06-18 20:14:57 -0400 |
commit | 29ea95a5c289b830c7a42f521af99d250c6fcfe9 (patch) | |
tree | 8473d6c7bf240c07d197b4dd1c7b9900ad4b0808 /dh_installinit | |
parent | c786806de1c7e0ccad9ebc3442cf65ed5f84e053 (diff) | |
download | debhelper-29ea95a5c289b830c7a42f521af99d250c6fcfe9.tar.gz |
dh_installinit: use absolute path to tmpfiles
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.
Diffstat (limited to 'dh_installinit')
-rwxr-xr-x | dh_installinit | 12 |
1 files changed, 7 insertions, 5 deletions
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}) { |