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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sun Jul 26 11:58:43 UTC 2009


Author: pere
Date: Sun Jul 26 11:58:41 2009
New Revision: 932

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=932
Log:
Change check-initd-order to return a exit code when there is a problem
with the boot sequence or dependencies.

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=932&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sun Jul 26 11:58:41 2009
@@ -1,3 +1,10 @@
+insserv (1.12.0-10) UNRELEASED; urgency=low
+
+  * Change check-initd-order to return a exit code when there is a problem
+    with the boot sequence or dependencies.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Sun, 26 Jul 2009 13:40:00 +0200
+
 insserv (1.12.0-9) unstable; urgency=low
 
   * Adjust patch 71_complete_makefile to make sure the recursion depth

Modified: trunk/src/insserv/debian/check-initd-order
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/check-initd-order?rev=932&op=diff
==============================================================================
--- trunk/src/insserv/debian/check-initd-order (original)
+++ trunk/src/insserv/debian/check-initd-order Sun Jul 26 11:58:41 2009
@@ -20,6 +20,7 @@
 my $hostoverridepath =  "/etc/insserv/overrides";
 
 my $debug = 0;
+my $errors = 0;
 
 my %rcmap =
     (
@@ -61,6 +62,7 @@
 }
 
 check_bootorder();
+exit $errors > 0 ? 1 : 0;
 
 sub usage {
     print STDERR "check-initd-order: error: @_\n" if ($#_ >= 0);
@@ -81,6 +83,11 @@
     my $path = shift;
     $path =~ s%^.*/([^/]+)$%$1%;
     return $path;
+}
+
+sub error {
+    print STDERR "error: ", @_;
+    $errors++;
 }
 
 # Map packages to system metapackages.  These dependencies should
@@ -108,7 +115,7 @@
     my %lsbinfo = %{$lsbinforef};
 
     unless ($lsbinfo{'provides'}) {
-        print STDERR "error: File ". $lsbinfo{'file'} . " is missing the provides header\n";
+        error "File ". $lsbinfo{'file'} . " is missing the provides header\n";
         $lsbinfo{'provides'} = $lsbinfo{'file'};
         $lsbinfo{'provides'} =~ s/^[SK]\d{2}//;
     }
@@ -183,7 +190,7 @@
                                            $useoverrides);
 
             unless (defined $lsbinforef) {
-                print STDERR "warning: LSB header missing in $rcbase/$rcdir/$script\n";
+                error "LSB header missing in $rcbase/$rcdir/$script\n";
                 $script =~ s/^[SK]\d{2}//;
                 $lsbinforef = {'provides'       => $script,
                                'required-start' => '$remote_fs $syslog',
@@ -239,9 +246,9 @@
                     } else {
                         $deporder = exists $provideslist{$dep} ? $provideslist{$dep} : "?";
                     }
-                    printf("Incorrect order %s@%s %s %s%s\n",
+                    error(sprintf("Incorrect order %s@%s %s %s%s\n",
                            $dep, $deporder, 'S' eq $tag ? '>' : '<',
-                           $name, $order);
+                           $name, $order));
                 }
             }
         }
@@ -306,7 +313,7 @@
                                        $useoverrides);
 
         unless (defined $lsbinforef) {
-            print STDERR "LSB header missing in $scriptpath\n";
+            error "LSB header missing in $scriptpath\n";
             next;
         }
         my %lsbinfo = %{$lsbinforef};




More information about the Initscripts-ng-commits mailing list