]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1849: * dh_installinit: If run with -o, do the inverse of -n and only 5.0.14
authorjoeyh <joeyh>
Sun, 8 Jan 2006 23:33:25 +0000 (23:33 +0000)
committerjoeyh <joeyh>
Sun, 8 Jan 2006 23:33:25 +0000 (23:33 +0000)
  set up maintainer script snippets, w/o installing any files.
  Useful for those edge cases where the init script is provided by upstream
  and not easily installed by dh_installinit but where it's worth letting
  it manage the maintainer scripts anyway. Closes: #140881, #184980
* -o might be added for other similar commands later if there is any
  reason to. And yeah, it means that -no is close to a no-op..

Debian/Debhelper/Dh_Getopt.pm
debian/changelog
dh_installinit
doc/PROGRAMMING

index 0c807b729adb2432d5bee2a8b74967d41bf61d3c..c7c831cad38d787ca56c622ee008d9b0dab4ea2e 100644 (file)
@@ -94,7 +94,9 @@ sub parseopts {
                "no-package=s" => \&ExcludePackage,
        
                "n" => \$options{NOSCRIPTS},
-               "noscripts" => \$options{NOSCRIPTS},
+               "noscripts" => \$options{ONLYSCRIPTS},
+               "o" => \$options{ONLYSCRIPTS},
+               "onlyscripts" => \$options{ONLYSCRIPTS},
 
                "x" => \$options{INCLUDE_CONFFILES}, # is -x for some unknown historical reason..
                "include-conffiles" => \$options{INCLUDE_CONFFILES},
index c27423c4c8f4c2c37349339f9975447c417ce692..5fe53a34d40460f07c8cdf5a9891312a28874c7c 100644 (file)
@@ -1,3 +1,15 @@
+debhelper (5.0.14) unstable; urgency=low
+
+  * dh_installinit: If run with -o, do the inverse of -n and only
+    set up maintainer script snippets, w/o installing any files.
+    Useful for those edge cases where the init script is provided by upstream
+    and not easily installed by dh_installinit but where it's worth letting
+    it manage the maintainer scripts anyway. Closes: #140881, #184980
+  * -o might be added for other similar commands later if there is any
+    reason to. And yeah, it means that -no is close to a no-op..
+
+ -- Joey Hess <joeyh@debian.org>  Sun,  8 Jan 2006 17:21:52 -0500
+
 debhelper (5.0.13) unstable; urgency=low
 
   [ Joey Hess ]
index aba32b8498892477003ea109a555476773ab70f3..36e9d7160539891614bd8ecaabd42afda30208ba 100755 (executable)
@@ -38,6 +38,13 @@ by the package name.
 
 Do not modify postinst/postrm/prerm scripts.
 
+=item B<-o>, B<--onlyscripts>
+
+Only modify postinst/postrm/prerm scripts, do not actually install any init
+script or default files. May be useful if the init script is shipped and/or
+installed by upstream in a way that doesn't make it easy to let
+dh_installinit find it.
+
 =item B<-r>, B<--no-restart-on-upgrade>
 
 Do not restart init script on upgrade.
@@ -81,6 +88,8 @@ preference to the files it normally installs.
 
 This parameter is deprecated, use the --name parameter instead.
 
+=item B<
+
 =item B<--error-handler=>I<function>
 
 Call the named shell function if running the init script fails. The
@@ -130,20 +139,22 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
              pkgfile($package,"init.d");
        my $default=pkgfile($package,'default');
 
-       if ($default ne '') {
+       if ($default ne '' && ! $dh{ONLYSCRIPTS}) {
                if (! -d "$tmp/etc/default") {
                        doit("install","-d","$tmp/etc/default");
                }
                doit("install","-p","-m644",$default,"$tmp/etc/default/$script");
        }
 
-       if ($init ne '') {
-               if (! -d "$tmp/etc/init.d") {
-                       doit("install","-d","$tmp/etc/init.d");
+       if ($init ne '' || $dh{ONLYSCRIPTS}) {
+               if (! $dh{ONLYSCRIPTS}) {
+                       if (! -d "$tmp/etc/init.d") {
+                               doit("install","-d","$tmp/etc/init.d");
+                       }
+               
+                       doit("install","-p","-m755",$init,"$tmp/etc/init.d/$script");
                }
-
-               doit("install","-p","-m755",$init,"$tmp/etc/init.d/$script");
-
+               
                # This is set by the -u "foo" command line switch, it's
                # the parameters to pass to update-rc.d. If not set,
                # we have to say "defaults".
index 9996dc73a9ee1a3292458829d823c11176e0ebe2..b87a8c6002eb5576bb386090af1872d4063ee7e7 100644 (file)
@@ -93,6 +93,9 @@ switch                variable        description
                                packages
 -n             NOSCRIPTS       if set, do not make any modifications to the 
                                package's postinst, postrm, etc scripts.
+-o             ONLYSCRIPTS     if set, only make modifications to the
+                               package's scripts, but don't look for or
+                               install associated files.
 -X             EXCLUDE         exclude a something from processing (you
                                decide what this means for your program)
                                (This is an array)