[debhelper-devel] [debhelper] 01/01: dh_installinit: Make -R the default in compat 10

Niels Thykier nthykier at moszumanska.debian.org
Sat Feb 27 11:14:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 18187bee56a1da4b76b090811bc7cea0d8c66039
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Feb 27 11:14:13 2016 +0000

    dh_installinit: Make -R the default in compat 10
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debhelper.pod    |  6 ++++++
 debian/changelog |  3 +++
 dh_installinit   | 17 ++++++++++++++---
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/debhelper.pod b/debhelper.pod
index 0e6ac9d..d05871c 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -597,6 +597,12 @@ F<maintscript> config file.  This was the original intend but it did
 not work properly and packages have begun to rely on the incomplete
 shell escaping (e.g. quoting file names).
 
+=item -
+
+The B<dh_installinit> command now defaults to
+B<--restart-after-upgrade>.  For packages needing the previous
+behaviour, please use B<--no-restart-after-upgrade>.
+
 =back
 
 =back
diff --git a/debian/changelog b/debian/changelog
index ce4f03e..ab6a457 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -34,6 +34,9 @@ debhelper (9.20160116) UNRELEASED; urgency=medium
   * dh_compress: Handle file resolution failures more gracefully.
     Thanks to Daniel Leidert for reporting this issue.
     (Closes: #802274)
+  * dh_installinit: Make --restart-after-upgrade the default in
+    compat 10.  Packages can undo this by using the new
+    --no-restart-after-upgrade parameter.
 
   [ Joachim Breitner ]
   * addsubstvar: Pass -a to grep to handle substvars with unicode content
diff --git a/dh_installinit b/dh_installinit
index b9fc7d6..981707b 100755
--- a/dh_installinit
+++ b/dh_installinit
@@ -84,14 +84,23 @@ call.  Example:
 =item B<-R>, B<--restart-after-upgrade>
 
 Do not stop the init script until after the package upgrade has been
-completed. This is different than the default behavior, which stops the
-script in the F<prerm>, and starts it again in the F<postinst>.
+completed.  This is the default behaviour in compat 10.
+
+In early compat levels, the default was to stop the script in the
+F<prerm>, and starts it again in the F<postinst>.
 
 This can be useful for daemons that should not have a possibly long
 downtime during upgrade. But you should make sure that the daemon will not
 get confused by the package being upgraded while it's running before using
 this option.
 
+=item B<--no-restart-after-upgrade>
+
+Undo a previous B<--restart-after-upgrade> (or the default of compat
+10).  If no other options are given, this will cause the service to be
+stopped in the F<prerm> script and started again in the F<postinst>
+script.
+
 =item B<-r>, B<--no-restart-on-upgrade>
 
 Do not stop init script on upgrade.
@@ -155,11 +164,13 @@ instances of the same text to be added to maintainer scripts.
 
 =cut
 
+$dh{RESTART_AFTER_UPGRADE} = 1 if not compat(10);
+
 init(options => {
 	"r" => \$dh{R_FLAG},
 	"no-restart-on-upgrade" => \$dh{R_FLAG},
 	"no-start" => \$dh{NO_START},
-	"R|restart-after-upgrade" => \$dh{RESTART_AFTER_UPGRADE},
+	"R|restart-after-upgrade!" => \$dh{RESTART_AFTER_UPGRADE},
 	"init-script=s" => \$dh{INIT_SCRIPT},
 	"update-rcd-params=s", => \$dh{U_PARAMS},
 	"remove-d" => \$dh{D_FLAG},

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list