[Initscripts-ng-commits] r1006 - in /trunk/src/insserv/debian: changelog check-initd-order
pere at users.alioth.debian.org
pere at users.alioth.debian.org
Sun Sep 20 08:10:38 UTC 2009
Author: pere
Date: Sun Sep 20 08:10:29 2009
New Revision: 1006
URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=1006
Log:
New argument -b to check-initd-order, to be able to replace /etc/
with another directory. This allow for easier testing of the script.
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=1006&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sun Sep 20 08:10:29 2009
@@ -1,3 +1,10 @@
+insserv (1.12.0-13) UNRELEASED; urgency=low
+
+ * New argument -b to check-initd-order, to be able to replace /etc/
+ with another directory. This allow for easier testing of the script.
+
+ -- Petter Reinholdtsen <pere at debian.org> Sun, 20 Sep 2009 10:08:59 +0200
+
insserv (1.12.0-12) unstable; urgency=low
* Use dh_lintian during build. Depend on debhelper (>= 6.0.7) for this.
Modified: trunk/src/insserv/debian/check-initd-order
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/check-initd-order?rev=1006&op=diff
==============================================================================
--- trunk/src/insserv/debian/check-initd-order (original)
+++ trunk/src/insserv/debian/check-initd-order Sun Sep 20 08:10:29 2009
@@ -14,7 +14,6 @@
use warnings;
my $rcbase = "/etc";
-#$rcbase = "/opt/ltsp/i386/etc";
my $overridepath = "/usr/share/insserv/overrides";
my $hostoverridepath = "/etc/insserv/overrides";
@@ -44,14 +43,15 @@
my %gotrevdeps;
my %allprovides;
-load_sysmap("/etc/insserv.conf");
-
while($#ARGV >= 0 && ($_ = $ARGV[0]) =~ /^-/) {
shift @ARGV;
if (/^-([cdgko])$/) { $opts{$1}++; next }
+ if (/^-b$/) { $rcbase = shift; next }
if (/^-h|--help$/) { &usage; }
&usage("unknown option");
}
+
+load_sysmap("$rcbase/insserv.conf");
$debug = $opts{'d'};
my $useoverrides = $opts{'o'} ? 0 : 1;
@@ -67,7 +67,8 @@
sub usage {
print STDERR "check-initd-order: error: @_\n" if ($#_ >= 0);
print STDERR <<EOF;
-usage: check-initd-order [-cdgko]
+usage: check-initd-order [-cdgko] [-b basedir]
+ -b basedir (default /etc)
-d enable debug output
-o do not load override files
-k use shutdown (reboot) sequence instead of boot sequence
@@ -94,7 +95,10 @@
# probably be more complex
sub load_sysmap {
my $filename = shift;
- open(CONF, "<", "$filename") || die "Unable to load $filename";
+ unless (open(CONF, "<", "$filename")) {
+ print STDERR "error: unable to load $filename";
+ return;
+ }
while (<CONF>) {
chomp;
s/\#.*$//;
@@ -262,7 +266,6 @@
my @dirs = $opts{'k'} ? $rcmap{6} : ($rcmap{S}, $rcmap{2});
my @scripts;
for my $rcdir (@dirs) {
-# chdir "$rcbase/$rcdir/.";
push(@scripts, $opts{'k'} ? <$rcbase/$rcdir/K*> : <$rcbase/$rcdir/S*>);
}
More information about the Initscripts-ng-commits
mailing list