]> git.donarmstrong.com Git - debhelper.git/commitdiff
dh_installinit: rework upstart handling to comply with new policy proposal; packages...
authorJoey Hess <joey@kitenet.net>
Tue, 10 Apr 2012 16:48:00 +0000 (12:48 -0400)
committerJoey Hess <joey@kitenet.net>
Tue, 10 Apr 2012 16:48:00 +0000 (12:48 -0400)
debian/changelog
debian/copyright
dh_installinit

index a2e876b02205fc5c75e64c418785659fe37edc7f..785ad87d10e2233e6b144884069f5a165b3b377b 100644 (file)
@@ -1,10 +1,17 @@
 debhelper (9.20120323) UNRELEASED; urgency=low
 
 debhelper (9.20120323) UNRELEASED; urgency=low
 
+  [ Joey Hess ]
   * Fix a typo. Closes: #665891
   * Conflict with too old automake for AM_UPDATE_INFO_DIR=no. Closes: #666901
   * dh_md5sums: Don't skip DEBIAN directories other than the control files
     one. Closes: #668276
 
   * Fix a typo. Closes: #665891
   * Conflict with too old automake for AM_UPDATE_INFO_DIR=no. Closes: #666901
   * dh_md5sums: Don't skip DEBIAN directories other than the control files
     one. Closes: #668276
 
+  [ Steve Langasek ]
+  * dh_installinit: rework upstart handling to comply with new policy
+    proposal; packages will ship both an init script and an upstart job,
+    instead of just an upstart job and a symlink to a compat wrapper.
+    Closes: #577040
+
  -- Joey Hess <joeyh@debian.org>  Mon, 26 Mar 2012 17:18:58 -0400
 
 debhelper (9.20120322) unstable; urgency=low
  -- Joey Hess <joeyh@debian.org>  Mon, 26 Mar 2012 17:18:58 -0400
 
 debhelper (9.20120322) unstable; urgency=low
index ceb743f590a88e64a80e4dfdb5d37bf18c46b6a7..4ec9761d2e1767b40f9201d873051d271104b4a0 100644 (file)
@@ -57,7 +57,7 @@ License: GPL-2+
 
 Files: dh_installinit
 Copyright: 1997-2008 Joey Hess <joeyh@debian.org>
 
 Files: dh_installinit
 Copyright: 1997-2008 Joey Hess <joeyh@debian.org>
-           2009 Canonical Ltd.
+           2009,2011 Canonical Ltd.
 License: GPL-3+
 
 Files: dh_installgsettings
 License: GPL-3+
 
 Files: dh_installgsettings
index d08798a82b4da54a54be2dd873d3b071d878cbb9..4daff14a377ee681f22f1c606e775ec9ce8562c6 100755 (executable)
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
 
 =head1 NAME
 
-dh_installinit - install upstart jobs or init scripts into package build directories
+dh_installinit - install upstart jobs and/or init scripts into package build directories
 
 =cut
 
 
 =cut
 
@@ -16,9 +16,8 @@ B<dh_installinit> [S<I<debhelper options>>] [B<--name=>I<name>] [B<-n>] [B<-R>]
 =head1 DESCRIPTION
 
 B<dh_installinit> is a debhelper program that is responsible for installing
 =head1 DESCRIPTION
 
 B<dh_installinit> is a debhelper program that is responsible for installing
-upstart job files or init scripts with associated defaults files into package
-build directories, and in the former case providing compatibility handling
-for non-upstart systems.
+upstart job files and init scripts with associated defaults files into
+package build directories.
 
 It also automatically generates the F<postinst> and F<postrm> and F<prerm> commands
 needed to set up the symlinks in F</etc/rc*.d/> to start and stop the init
 
 It also automatically generates the F<postinst> and F<postrm> and F<prerm> commands
 needed to set up the symlinks in F</etc/rc*.d/> to start and stop the init
@@ -35,8 +34,8 @@ build directory.
 
 =item debian/I<package>.init
 
 
 =item debian/I<package>.init
 
-Otherwise, if this exists, it is installed
-into etc/init.d/I<package> in the package build directory.
+If this exists, it is installed into etc/init.d/I<package> in the package
+build directory.
 
 =item debian/I<package>.default
 
 
 =item debian/I<package>.default
 
@@ -60,11 +59,6 @@ script, default files, or upstart job. May be useful if the init script or
 upstart job is shipped and/or installed by upstream in a way that doesn't
 make it easy to let B<dh_installinit> find it.
 
 upstart job is shipped and/or installed by upstream in a way that doesn't
 make it easy to let B<dh_installinit> find it.
 
-If no upstart job file is installed in the target directory when
-B<dh_installinit --onlyscripts> is called, this program will assume that an
-init script is being installed and not provide the compatibility symlinks
-or upstart dependencies.
-
 =item B<-R>, B<--restart-after-upgrade>
 
 Do not stop the init script until after the package upgrade has been
 =item B<-R>, B<--restart-after-upgrade>
 
 Do not stop the init script until after the package upgrade has been
@@ -88,7 +82,7 @@ Only call B<update-rc.d>. Useful for rcS scripts.
 =item B<-d>, B<--remove-d>
 
 Remove trailing B<d> from the name of the package, and use the result for the
 =item B<-d>, B<--remove-d>
 
 Remove trailing B<d> from the name of the package, and use the result for the
-filename the upstart job file is installed as in F<etc/init/> , or for the
+filename the upstart job file is installed as in F<etc/init/> , and for the
 filename the init script is installed as in etc/init.d and the default file
 is installed as in F<etc/default/> . This may be useful for daemons with names
 ending in B<d>. (Note: this takes precedence over the B<--init-script> parameter
 filename the init script is installed as in etc/init.d and the default file
 is installed as in F<etc/default/> . This may be useful for daemons with names
 ending in B<d>. (Note: this takes precedence over the B<--init-script> parameter
@@ -103,7 +97,7 @@ passed to L<update-rc.d(8)>.
 
 =item B<--name=>I<name>
 
 
 =item B<--name=>I<name>
 
-Install the upstart job file or the init script (and default file) using the
+Install the upstart job file and init script (and default file) using the
 filename I<name> instead of the default filename, which is the package name.
 When this parameter is used, B<dh_installinit> looks for and installs files
 named F<debian/package.name.upstart>, F<debian/package.name.init> and
 filename I<name> instead of the default filename, which is the package name.
 When this parameter is used, B<dh_installinit> looks for and installs files
 named F<debian/package.name.upstart>, F<debian/package.name.init> and
@@ -120,7 +114,7 @@ F<package.scriptname> and if so will install it as the init script in
 preference to the files it normally installs.
 
 This parameter is deprecated, use the B<--name> parameter instead. This
 preference to the files it normally installs.
 
 This parameter is deprecated, use the B<--name> parameter instead. This
-parameter will be ignored completely for upstart jobs.
+parameter is incompatible with the use of upstart jobs.
 
 =item B<--error-handler=>I<function>
 
 
 =item B<--error-handler=>I<function>
 
@@ -175,31 +169,15 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        else {
                $script=$package;
        }       
        else {
                $script=$package;
        }       
-       
+
        my $job=pkgfile($package,"upstart");
        my $job=pkgfile($package,"upstart");
-       my $init='';
 
 
-       if ($job ne '' || ($dh{ONLYSCRIPTS} && -e "$tmp/etc/init/$jobfile.conf")) {
-               if (! $dh{ONLYSCRIPTS}) {
-                       if (! -d "$tmp/etc/init") {
-                               doit("install","-d","$tmp/etc/init");
-                       }
-               
-                       doit("install","-p","-m644",$job,"$tmp/etc/init/$jobfile.conf");
+       if ($job ne '' && ! $dh{ONLYSCRIPTS}) {
+               if (! -d "$tmp/etc/init") {
+                       doit("install","-d","$tmp/etc/init");
                }
                
                }
                
-               # ensures that our /etc/init.d/ symlink points to a valid
-               # implementation
-               addsubstvar($package, "misc:Depends", "upstart-job");
-
-               if (! -d "$tmp/etc/init.d") {
-                       doit("install","-d","$tmp/etc/init.d");
-               }
-               doit("ln","-sf","/lib/init/upstart-job","$tmp/etc/init.d/$jobfile");
-       }
-       else {
-               $init=pkgfile($package,$script) || pkgfile($package,"init") ||
-                       pkgfile($package,"init.d");
+               doit("install","-p","-m644",$job,"$tmp/etc/init/$jobfile.conf");
        }
 
        my $default=pkgfile($package,'default');
        }
 
        my $default=pkgfile($package,'default');
@@ -210,6 +188,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                doit("install","-p","-m644",$default,"$tmp/etc/default/$script");
        }
 
                doit("install","-p","-m644",$default,"$tmp/etc/default/$script");
        }
 
+       my $init=pkgfile($package,$script) || pkgfile($package,"init") ||
+               pkgfile($package,"init.d");
        if ($init ne '' && ! $dh{ONLYSCRIPTS}) {
                if (! -d "$tmp/etc/init.d") {
                        doit("install","-d","$tmp/etc/init.d");
        if ($init ne '' && ! $dh{ONLYSCRIPTS}) {
                if (! -d "$tmp/etc/init.d") {
                        doit("install","-d","$tmp/etc/init.d");
@@ -218,11 +198,11 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                doit("install","-p","-m755",$init,"$tmp/etc/init.d/$script");
        }
 
                doit("install","-p","-m755",$init,"$tmp/etc/init.d/$script");
        }
 
-       if ($job ne '' || $init ne '' || $dh{ONLYSCRIPTS}) {
-               if (-e "$tmp/etc/init/$jobfile.conf") {
-                       $script=$jobfile;
-               }
+       if ($dh{INIT_SCRIPT} && $job ne '' && $init ne '') {
+               error("Can't use --init-script with an upstart job");
+       }
 
 
+       if ($job ne '' || $init ne '' || $dh{ONLYSCRIPTS}) {
                # 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".
                # 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".