[Pkg-sysvinit-commits] r843 - in sysvinit/trunk/debian: . sysv-rc/sbin

Petter Reinholdtsen pere at costa.debian.org
Wed Sep 6 07:57:05 UTC 2006


Author: pere
Date: 2006-09-06 07:57:05 +0000 (Wed, 06 Sep 2006)
New Revision: 843

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d
Log:
    Only enable this feature when /etc/update-rc.d-lsbparse exist
    while we verify that LSB headers are correct.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2006-09-06 07:20:18 UTC (rev 842)
+++ sysvinit/trunk/debian/changelog	2006-09-06 07:57:05 UTC (rev 843)
@@ -47,6 +47,8 @@
     if they are present.  Document this in update-rc.d(8).  This can
     be used instead of the 'multiuser' extention in Ubuntu, by setting
     the 'default-stop' value to '1' in the init.d script.
+    Only enable this feature when /etc/update-rc.d-lsbparse exist
+    while we verify that LSB headers are correct.
 
  -- Petter Reinholdtsen <pere at debian.org>  Wed, 26 Jul 2006 11:37:23 +0200
 

Modified: sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d
===================================================================
--- sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d	2006-09-06 07:20:18 UTC (rev 842)
+++ sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d	2006-09-06 07:57:05 UTC (rev 843)
@@ -10,6 +10,11 @@
 my $etcd  = "/etc/rc";
 my $notreally = 0;
 
+# Only parse the LSB headers when this flag exist.  It is to be used
+# while we test this new feature, and should be removed when we are
+# confident that LSB headers are correct. [pere 2006-09-06]
+my $lsbparseflag = "/etc/update-rc.d-lsbparse";
+
 # Print usage message and die.
 
 sub usage {
@@ -121,19 +126,20 @@
 sub parse_lsb_header {
     my $initdscript = shift;
     my %lsbinfo;
-    my $lsbfound = 0;
-    my $lsbheaders = "Provides|Default-Start|Default-Stop";
-    open(INIT, "<$initdscript") || die "error: unable to read $initdscript";
-    while (<INIT>) {
-	chomp;
-	$lsbfound = 1 if (m/^\#\#\# BEGIN INIT INFO$/);
-	last if (m/\#\#\# END INIT INFO$/);
-	if (m/^\# (Default-Start|Default-stop):\s*(\S?.*)$/i) {
-	    $lsbinfo{lc($1)} = $2;
+    if (-e $lsbparseflag) {
+	my $lsbfound = 0;
+	my $lsbheaders = "Provides|Default-Start|Default-Stop";
+	open(INIT, "<$initdscript") || die "error: unable to read $initdscript";
+	while (<INIT>) {
+	    chomp;
+	    $lsbfound = 1 if (m/^\#\#\# BEGIN INIT INFO$/);
+	    last if (m/\#\#\# END INIT INFO$/);
+	    if (m/^\# (Default-Start|Default-stop):\s*(\S?.*)$/i) {
+		$lsbinfo{lc($1)} = $2;
+	    }
 	}
-		  
+	close(INIT);
     }
-    close(INIT);
     return %lsbinfo;
 }
 




More information about the Pkg-sysvinit-commits mailing list