summaryrefslogtreecommitdiff
path: root/dh_installinit
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-02-02 00:08:11 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-02-02 00:08:11 +0400
commit9647b430c39e363ce467317ef4cb9995695a6701 (patch)
tree771817badcf58e0d7a1cea563415a6951a96e1db /dh_installinit
parentdd37b44924249c1e24be6db11827de33cdeb0af5 (diff)
parentb4ad930ad2d7f9d94e9cc3395e6f000c4094886e (diff)
downloaddebhelper-9647b430c39e363ce467317ef4cb9995695a6701.tar.gz
Merge git://git.debian.org/git/debhelper/debhelper
Conflicts: debian/changelog
Diffstat (limited to 'dh_installinit')
-rwxr-xr-xdh_installinit24
1 files changed, 18 insertions, 6 deletions
diff --git a/dh_installinit b/dh_installinit
index 1421bf93..21fc2171 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -167,6 +167,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
# Figure out what filename to install it as.
my $script;
+ my $scriptsrc;
my $jobfile=$package;
if (defined $dh{NAME}) {
$jobfile=$script=$dh{NAME};
@@ -182,12 +183,20 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
else {
warning("\"$package\" has no final d' in its name, but -d was specified.");
}
+ $scriptsrc=$script;
}
elsif ($dh{INIT_SCRIPT}) {
$script=$dh{INIT_SCRIPT};
+ $scriptsrc=$script;
}
else {
$script=$package;
+ if (compat(9)) {
+ $scriptsrc=$script;
+ }
+ else {
+ $scriptsrc="init";
+ }
}
my $service=pkgfile($package,"service");
@@ -227,8 +236,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
doit("install","-p","-m644",$default,"$tmp/etc/default/$script");
}
- my $init=pkgfile($package,$script) || pkgfile($package,"init") ||
+ my $init=pkgfile($package,$scriptsrc) || pkgfile($package,"init") ||
pkgfile($package,"init.d");
+
if ($init ne '' && ! $dh{ONLYSCRIPTS}) {
if (! -d "$tmp/etc/init.d") {
doit("install","-d","$tmp/etc/init.d");
@@ -264,17 +274,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}) {