From 0d519c8fd379afbed7ff4ec1c141e0b4097bcd37 Mon Sep 17 00:00:00 2001 From: joeyh Date: Sun, 8 Jan 2006 23:33:25 +0000 Subject: r1849: * 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.. --- dh_installinit | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'dh_installinit') diff --git a/dh_installinit b/dh_installinit index aba32b84..36e9d716 100755 --- a/dh_installinit +++ b/dh_installinit @@ -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 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". -- cgit v1.2.3