]> git.donarmstrong.com Git - debhelper.git/commitdiff
r557: * dh_installinit: added --no-start for rcS type scripts. Closes: #136502
authorjoey <joey>
Fri, 11 Oct 2002 17:54:50 +0000 (17:54 +0000)
committerjoey <joey>
Fri, 11 Oct 2002 17:54:50 +0000 (17:54 +0000)
Debian/Debhelper/Dh_Getopt.pm
autoscripts/postinst-init-nostart [new file with mode: 0644]
debian/changelog
dh_install
dh_installinit

index 38aa342447c110d5cac695d620e946071ea4f703..1e90e08a95c64be8c5e2cb691cce913a22de5cf5 100644 (file)
@@ -101,6 +101,7 @@ sub parseopts {
        
                "r" => \$options{R_FLAG},
                "no-restart-on-upgrade" => \$options{R_FLAG},
+               "no-start" => \$options{NO_START},
        
                "k" => \$options{K_FLAG},
                "keep" => \$options{K_FLAG},
diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart
new file mode 100644 (file)
index 0000000..5d882b6
--- /dev/null
@@ -0,0 +1,3 @@
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+       update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+fi
index 81b37007e14d2a42d5e1a606589ce8bd5a51e07e..792443e6a182adabd365c112272ab15a3779a0a7 100644 (file)
@@ -1,3 +1,9 @@
+debhelper (4.1.17) unstable; urgency=low
+
+  * dh_installinit: added --no-start for rcS type scripts. Closes: #136502
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 11 Oct 2002 13:58:22 -0400
+
 debhelper (4.1.16) unstable; urgency=low
 
   * Depend on po-debconf, and I hope I can drop the debconf-utils dep soon.
index af55f9f82e9b640ff25a4a2a643962e0b3294fec..004e21f06c79c8660f496e345b169ceb6d14aef5 100755 (executable)
@@ -12,7 +12,7 @@ use Debian::Debhelper::Dh_Lib;
 
 =head1 SYNOPSIS
 
-B<dh_install> [B<-X>I<item>] [B<--autodest>] [B<--list-missing>] [S<I<debhelper options>>] [S<I<file [...] dest>>]
+B<dh_install> [B<-X>I<item>] [B<--autodest>] [B<--list-missing>] [B<--sourcedir=>I<dir>] [S<I<debhelper options>>] [S<I<file [...] dest>>]
 
 =head1 DESCRIPTION
 
index c5652c457094f193796cc2d8dd02de0f562964f6..a9070f2d6891e3988aa8f71dba8feedc9cd84f1c 100755 (executable)
@@ -40,7 +40,12 @@ Do not modify postinst/postrm/prerm scripts.
 
 =item B<-r>, B<--no-restart-on-upgrade>
 
-Do not restart daemon on upgrade.
+Do not restart init script on upgrade.
+
+=item B<--no-start>
+
+Do not start the init script at on install or upgrade, or stop it on removal.
+Only call update-rc.d. Useful for rcS scripts.
 
 =item B<-d>, B<--remove-d>
 
@@ -135,19 +140,29 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 
                my $substvaradded=0;
                if (! $dh{NOSCRIPTS}) {
-                       autoscript($package,"postinst", "postinst-init",
-                               "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
-                       # -r on the command line sets R_FLAG. If it's set,
-                       # there  is no restart on upgrade, so don't stop
-                       # daemon. (It's ok that it's always started.)
-                       if ($dh{R_FLAG}) {
-                               autoscript($package,"prerm","prerm-init-norestart",
+                       if (! $dh{NO_START}) {
+                               # update-rc.d, and start script
+                               autoscript($package,"postinst", "postinst-init",
                                        "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+                       
+                               if ($dh{R_FLAG}) {
+                                       # stops script only on remove
+                                       autoscript($package,"prerm","prerm-init-norestart",
+                                               "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+                               }
+                               else {
+                                       # always stops script
+                                       autoscript($package,"prerm","prerm-init",
+                                               "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
+                               }
                        }
                        else {
-                               autoscript($package,"prerm","prerm-init",
+                               # just update-rc.d
+                               autoscript($package,"postinst", "postinst-init-nostart",
                                        "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
                        }
+
+                       # removes rc.d links
                        autoscript($package,"postrm","postrm-init",
                                "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/");
                }