[Pkg-sysvinit-commits] r1674 - sysvinit/trunk/debian/sysv-rc/sbin

Kel Modderman kelmo-guest at alioth.debian.org
Mon Aug 31 16:20:53 UTC 2009


Author: kelmo-guest
Date: 2009-08-31 16:20:53 +0000 (Mon, 31 Aug 2009)
New Revision: 1674

Modified:
   sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d
Log:
Fix processing of arguments for comparison with LSB info. Add comment to help me understand my decisions later.

Modified: sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d
===================================================================
--- sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d	2009-08-31 15:52:15 UTC (rev 1673)
+++ sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d	2009-08-31 16:20:53 UTC (rev 1674)
@@ -469,10 +469,6 @@
     @lsb_stop_lvls  = @$lsb_stop_ref;
     return if (!@lsb_start_lvls and !@lsb_stop_lvls);
 
-    if (defined $_[0]) {
-        shift if ($_[0] !~ /^(start|stop|defaults)$/);
-    }
-
     if ($act eq 'defaults') {
         @arg_start_lvls = (2, 3, 4, 5);
         @arg_stop_lvls  = (0, 1, 6);
@@ -480,7 +476,12 @@
         my $start = $act eq 'start' ? 1 : 0;
         my $stop = $act eq 'stop' ? 1 : 0;
 
-        my $argi = 0;
+        # The legacy part of this program passes arguments starting with
+        # "start|stop NN x y z ." but the insserv part gives argument list
+        # starting with sequence number (ie. strips off leading "start|stop")
+        # Start processing arguments immediately after the first seq number.
+        my $argi = $_[0] eq $act ? 2 : 1;
+
         while (defined $_[$argi]) {
             my $arg = $_[$argi];
             if ($arg eq 'start') {
@@ -514,7 +515,7 @@
                 "LSB Default-Stop values ($lsb_str)";
     }
 
-    warning "arguments \`$act @_' overridden by $name LSB info" if $differ;
+    warning "command line arguments overridden by $name LSB info" if $differ;
 }
 
 sub insserv_toggle {




More information about the Pkg-sysvinit-commits mailing list