summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-08-11 21:21:24 +0200
committerJoey Hess <joey@kitenet.net>2013-08-11 21:21:24 +0200
commitfeb76f76e099df14be6ca5c33baf91d0a4f307a9 (patch)
treee6e2f30e0ac663066963a140d8adbb37c8aec7a8
parent7b0d501cecd3cf0a631b63d31bbd6f8adfa8bb6d (diff)
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
-rw-r--r--debhelper.pod5
-rw-r--r--debian/changelog4
-rwxr-xr-xdh_installinit11
3 files changed, 19 insertions, 1 deletions
diff --git a/debhelper.pod b/debhelper.pod
index 7ad3e94..216360b 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -532,6 +532,11 @@ This compatibility level is still open for development; use with caution.
Changes from v9 are:
+=item -
+
+B<dh_installinit> will no longer install a file named debian/I<package>
+as an init script.
+
=over 8
=item -
diff --git a/debian/changelog b/debian/changelog
index edd3cf3..c14d976 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,10 @@ debhelper (9.20130631) UNRELEASED; urgency=low
Closes: #717374
(Thanks, Luca Falavigna)
* Type fixes. Closes: #719216
+ * 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
-- Joey Hess <joeyh@debian.org> Fri, 19 Jul 2013 18:47:27 -0400
diff --git a/dh_installinit b/dh_installinit
index 7ee16ef..d7c8f75 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")) {