diff options
author | joey <joey> | 2002-01-27 06:34:33 +0000 |
---|---|---|
committer | joey <joey> | 2002-01-27 06:34:33 +0000 |
commit | 81a1cb9028b75304b0261dfd91ba04c0e6b07bb4 (patch) | |
tree | 6d0e7665b9271a2724f36db307c267da45822f4b /dh_installinit | |
parent | 26fc54549b83f4efd2db161b86159dd65da974a9 (diff) | |
download | debhelper-81a1cb9028b75304b0261dfd91ba04c0e6b07bb4.tar.gz |
r506: * Introduced the debian/compat file. This is the new, preferred way to say
what debhelper compatability level your package uses. It has the big
advantage of being available to debhelper when you run it at the command
line, as well as in debian/rules.
* A new v4 feature: dh_installinit, in v4 mode, will use invoke-rc.d.
This is in v4 for testing, but I may well roll it back into v3 (and
earlier) once woody is released and I don't have to worry about breaking
things (and, presumably, once invoke-rc.d enters policy).
* Some debhelper commands will now build up a new substvars variable,
${misc:Depends}, based on things they know your package needs to depend
on. For example, dh_installinit in v4 mode adds sysvinit (>= 2.80-1) to
that dep list, and dh_installxfonts adds a dep on xutils. This variable
should make it easier to keep track of what your package needs to depends
on, supplimenting the ${shlibs:Depends} and ${perl:Depends} substvars.
Hmm, this appears to be based loosely on an idea by Masato Taruishi
<taru@debian.org>, filtered through a long period of mulling it over.
Closes: #76352
* Use the addsubstvar function I wrote for the above in dh_perl too.
Diffstat (limited to 'dh_installinit')
-rwxr-xr-x | dh_installinit | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/dh_installinit b/dh_installinit index d8ab80b8..8af1751e 100755 --- a/dh_installinit +++ b/dh_installinit @@ -30,6 +30,12 @@ If a file named debian/package.default exists, then it is installed into etc/default/package in the package build directory, with "package" replaced by the package name. +Historically this program generates postrm and prerm commands that run the +init scripts by hand. In V4 mode, it uses the invoke-rc.d program instead. +See L<debhelper(1)> for details about V4 mode. If you decide to use this, you +should make your package depend on sysvinit (>= 2.80-1) (this dependency is +added to ${misc:Depends} by this program in V4 mode). + =head1 OPTIONS =over 4 @@ -133,25 +139,40 @@ foreach my $package (@{$dh{DOPACKAGES}}) { $params="defaults"; } + my $substvaradded=0; if (! $dh{NOSCRIPTS}) { - # -r on the command line sets R_FLAG. If it's set, there - # is no restart on upgrade. + # In v4 mode, use invoke-rc.d versions of the + # autoscripts; prior to that use the old, + # manual-invoking versions. + my $tailstr=""; + if (! compat(3)) { + $tailstr="-invoke"; + addsubstvar($package, "misc:Depends", "sysvinit", ">= 2.80-1"); + $substvaradded=1; + } + # -r on the command line sets R_FLAG. If it's set, + # there is no restart on upgrade. if ($dh{R_FLAG}) { - autoscript($package,"postinst", "postinst-init-norestart", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($package,"postrm","postrm-init", + autoscript($package,"postinst", "postinst-init-norestart$tailstr", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($package,"prerm","prerm-init-norestart", + autoscript($package,"prerm","prerm-init-norestart$tailstr", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); } else { - autoscript($package,"postinst","postinst-init", + autoscript($package,"postinst","postinst-init$tailstr", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($package,"postrm","postrm-init", - "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); - autoscript($package,"prerm","prerm-init", + autoscript($package,"prerm","prerm-init$tailstr", "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); } + # This script just removes the links, so it's the + # same for all varients. + autoscript($package,"postrm","postrm-init", + "s/#SCRIPT#/$script/;s/#INITPARMS#/$params/"); + } + + if (! $substvaradded) { + # Remove it, for idemotency's sake. + addsubstvar($package, "misc:Depends", "sysvinit", ">= 2.80-1", 1); } } } |