[Pkg-sysvinit-commits] r1670 - sysvinit/trunk/debian/sysv-rc/sbin
Kel Modderman
kelmo-guest at alioth.debian.org
Mon Aug 31 15:06:00 UTC 2009
Author: kelmo-guest
Date: 2009-08-31 15:06:00 +0000 (Mon, 31 Aug 2009)
New Revision: 1670
Modified:
sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d
Log:
Fix cmp_args_with_defaults for consideration of sequence numbers as arguments after a keyword instead of depending on them to be a 0 padded two digit number.
Modified: sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d
===================================================================
--- sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d 2009-08-31 14:09:23 UTC (rev 1669)
+++ sysvinit/trunk/debian/sysv-rc/sbin/update-rc.d 2009-08-31 15:06:00 UTC (rev 1670)
@@ -470,6 +470,8 @@
@lsb_stop_lvls = @$lsb_stop_ref;
return if (!@lsb_start_lvls and !@lsb_stop_lvls);
+ shift if ($_[0] ne 'start' and $_[0] ne 'stop' and $act ne 'defaults');
+
if ($act eq 'defaults') {
@arg_start_lvls = (2, 3, 4, 5);
@arg_stop_lvls = (0, 1, 6);
@@ -477,18 +479,20 @@
my $start = $act eq 'start' ? 1 : 0;
my $stop = $act eq 'stop' ? 1 : 0;
- foreach my $arg (@_) {
+ my $argi = 0;
+ while (defined $_[$argi]) {
+ my $arg = $_[$argi];
if ($arg eq 'start') {
- $start = 1; $stop = 0; next;
+ $start = 1; $stop = 0; $argi++; next;
} elsif ($arg eq 'stop') {
- $start = 0; $stop = 1; next;
- } elsif ($arg =~ /^[0-9]{2}$/) {
- next;
+ $start = 0; $stop = 1; $argi++; next;
} elsif ($arg eq '.') {
next;
}
push(@arg_start_lvls, $arg) if $start;
push(@arg_stop_lvls, $arg) if $stop;
+ } continue {
+ $argi++;
}
}
More information about the Pkg-sysvinit-commits
mailing list