[Initscripts-ng-commits] r280 - in /trunk/src/insserv/debian: changelog check-initd-order

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sat Nov 17 19:58:03 UTC 2007


Author: pere
Date: Sat Nov 17 19:58:03 2007
New Revision: 280

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=280
Log:
  * Let /usr/share/insserv/check-initd-order read override files in
    /etc/insserv/overrides/ just like insserv does.  Patch from Arjan
    Oosting.  (Closes: #429398)

Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/check-initd-order

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=280&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sat Nov 17 19:58:03 2007
@@ -2,6 +2,9 @@
 
   * New upstream release. (Closes: #426091)
     - Support X-Start-Before and X-Stop-After (Closes: #326120)
+  * Let /usr/share/insserv/check-initd-order read override files in
+    /etc/insserv/overrides/ just like insserv does.  Patch from Arjan
+    Oosting.  (Closes: #429398)
   * Correct the dependencies for nbd-client and libnss-ldap.
   * Add override file for spamassassin.
 

Modified: trunk/src/insserv/debian/check-initd-order
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/check-initd-order?rev=280&op=diff
==============================================================================
--- trunk/src/insserv/debian/check-initd-order (original)
+++ trunk/src/insserv/debian/check-initd-order Sat Nov 17 19:58:03 2007
@@ -17,6 +17,7 @@
 #$rcbase = "/opt/ltsp/i386/etc";
 
 my $overridepath = "/usr/share/insserv/overrides";
+my $hostoverridepath =  "/etc/insserv/overrides";
 
 my $debug = 0;
 
@@ -208,7 +209,33 @@
 
 sub load_lsb_tags {
     my ($initfile, $useoverrides) = @_;
-    print STDERR "Loading $initfile\n" if $debug;
+    my $lsbinforef = load_lsb_tags_from_file($initfile);
+
+    if ($useoverrides) {
+	# Try override file
+	$initfile = readlink($initfile) if (-l $initfile);
+	my $basename = basename($initfile);
+
+	# Only read shipped override file when initscript does not
+	# contain LSB tags.
+	if (! defined($lsbinforef) && -f "$overridepath/$basename") {
+	    print STDERR "Override $overridepath/$basename\n" if $debug;
+	    $lsbinforef = load_lsb_tags_from_file("$overridepath/$basename");
+	}
+
+	# Always read the host override in $hostoverridepath.
+	if (-f "$hostoverridepath/$basename") {
+	    print STDERR "Override $hostoverridepath/$basename\n" if $debug;
+	    $lsbinforef = load_lsb_tags_from_file("$hostoverridepath/$basename");
+	}
+
+    }
+    return $lsbinforef;
+}
+
+sub load_lsb_tags_from_file {
+    my ($file) = @_;
+    print STDERR "Loading $file\n" if $debug;
     ### BEGIN INIT INFO
     # Provides:          xdebconfigurator
     # Required-Start:    $syslog
@@ -219,8 +246,8 @@
     # Description:       Preseed X configuration and use dexconf to
     #                    genereate a new configuration file.
     ### END INIT INFO
-    unless (open(FILE, "<$initfile")) {
-        warn "error: Unable to read $initfile";
+    unless (open(FILE, "<$file")) {
+        warn "error: Unable to read $file";
 	return;
     }
     my $found = 0;
@@ -239,17 +266,6 @@
     }
     close(FILE);
 
-    # Try override file
-    $initfile = readlink($initfile) if (-l $initfile);
-    my $basename = basename($initfile);
-
-    if (!$found) {
-	if ($useoverrides && -f "$overridepath/$basename") {
-	    print STDERR "Override $overridepath/$basename\n"
-		if $debug;
-	    return load_lsb_tags("$overridepath/$basename", $useoverrides);
-	}
-    }
     return undef unless ($found);
 
 #    print "Provides: $provides\n" if $provides;
@@ -259,6 +275,6 @@
 	    'required-stop'  => $requiredstop,
 	    'should-start'   => $shouldstart,
 	    'should-stop'    => $shouldstop,
-	    'file'           => $initfile,
+	    'file'           => $file,
 	    };
 }




More information about the Initscripts-ng-commits mailing list