diff options
author | Joey Hess <joey@kitenet.net> | 2013-08-11 21:21:24 +0200 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-08-11 21:21:24 +0200 |
commit | feb76f76e099df14be6ca5c33baf91d0a4f307a9 (patch) | |
tree | e6e2f30e0ac663066963a140d8adbb37c8aec7a8 /dh_installinit | |
parent | 7b0d501cecd3cf0a631b63d31bbd6f8adfa8bb6d (diff) | |
download | debhelper-feb76f76e099df14be6ca5c33baf91d0a4f307a9.tar.gz |
dh_installinit: Fix a longstanding accidental behavior that caused a file named debian/package to be installed as the init script. Only fixed in v10 since packages might depend on this behavior. Closes: #719359
Diffstat (limited to 'dh_installinit')
-rwxr-xr-x | dh_installinit | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/dh_installinit b/dh_installinit index 7ee16ef0..d7c8f75d 100755 --- a/dh_installinit +++ b/dh_installinit @@ -162,6 +162,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}; @@ -177,12 +178,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"); @@ -222,7 +231,7 @@ 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 ($job ne '' || ($dh{ONLYSCRIPTS} && -e "$tmp/etc/init/$jobfile.conf")) { |