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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Wed Sep 13 09:51:33 UTC 2006


Author: pere
Date: Wed Sep 13 09:51:33 2006
New Revision: 206

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=206
Log:
  * Rewrite check-initd-order to avoid the dependency on perl-modules,
    to make it easier to run in systems with small disks.

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

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=206&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Wed Sep 13 09:51:33 2006
@@ -5,6 +5,8 @@
   * Modify override file for lvm to document that it should stop just
     before halt and reboot.
   * Modify override file for exim4 to only conditional depend on $named.
+  * Rewrite check-initd-order to avoid the dependency on perl-modules,
+    to make it easier to run in systems with small disks.
 
  -- Petter Reinholdtsen <pere at debian.org>  Mon, 11 Sep 2006 18:01:44 +0200
 

Modified: trunk/src/insserv/debian/check-initd-order
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/check-initd-order?rev=206&op=diff
==============================================================================
--- trunk/src/insserv/debian/check-initd-order (original)
+++ trunk/src/insserv/debian/check-initd-order Wed Sep 13 09:51:33 2006
@@ -12,8 +12,6 @@
 
 use strict;
 use warnings;
-use Getopt::Std;
-use File::Basename;
 
 my $rcbase = "/etc";
 #$rcbase = "/opt/ltsp/i386/etc";
@@ -57,7 +55,12 @@
 my %scriptorder;
 my %opts;
 
-getopts('dgok', \%opts);
+while($#ARGV >= 0 && ($_ = $ARGV[0]) =~ /^-/) {
+	shift @ARGV;
+	if (/^-([dgko])$/) { $opts{$1}++; next }
+	if (/^-h|--help$/) { &usage; }
+	&usage("unknown option");
+}
 
 $debug = $opts{'d'};
 my $useoverrides = $opts{'o'} ? 0 : 1;
@@ -68,6 +71,22 @@
 }
 
 check_bootorder();
+
+sub usage {
+    print STDERR "check-initd-order: error: @_\n" if ($#_ >= 0);
+    print STDERR <<EOF;
+usage: check-initd-order [-dgko]
+EOF
+    exit 1;
+}
+
+# Simple basename implementatin to avoid dependin on File::Basename
+# from perl-modules
+sub basename {
+    my $path = shift;
+    $path =~ s%^.*/([^/]+)$%$1%;
+    return $path;
+}
 
 sub graph_addnode {
     my %lsbinfo = @_;
@@ -169,9 +188,14 @@
 		    for my $dep (@depends) {
 			unless (exists $scriptorder{$tag}{$dep}
 				and $scriptorder{$tag}{$dep} < $bootorder) {
+			    my $deporder;
+			    if (exists $scriptorder{$tag}{$dep}) {
+				$deporder = $scriptorder{$tag}{$dep}
+			    } else {
+				$deporder = "?";
+			    }
 			    print "Incorrect order " .
-				"$dep\@". $scriptorder{$tag}{$dep} .
-				" > $name\@$order\n";
+				"$dep\@$deporder > $name\@$order\n";
 			}
 		    }
 		}

Modified: trunk/src/insserv/debian/control
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/control?rev=206&op=diff
==============================================================================
--- trunk/src/insserv/debian/control (original)
+++ trunk/src/insserv/debian/control Wed Sep 13 09:51:33 2006
@@ -8,7 +8,6 @@
 Package: insserv
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, sysv-rc
-Recommends: perl-modules
 Suggests: bootchart
 Description: Reorder boot sequence based on LSB init.d script dependencies
  Reorder the boot order based on init.d script dependencies as




More information about the Initscripts-ng-commits mailing list