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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Mon Dec 31 12:01:35 UTC 2007


Author: pere
Date: Mon Dec 31 12:01:35 2007
New Revision: 366

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=366
Log:
  * Extend check-initd-order to handle reverse dependencies
    (X-Start-Before and X-Stop-AFter) when drawing graphs.  Draw such
    dependencies in yellow.

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=366&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Mon Dec 31 12:01:35 2007
@@ -6,6 +6,9 @@
   * Remove override files courier-ldap, courier-authdaemon,
     courier-imap-ssl and courier-imap, as the defaults are
     better than the proposed overrides.
+  * Extend check-initd-order to handle reverse dependencies
+    (X-Start-Before and X-Stop-AFter) when drawing graphs.  Draw such
+    dependencies in yellow.
 	
  -- Petter Reinholdtsen <pere at debian.org>  Sun, 30 Dec 2007 20:48:47 +0100
 

Modified: trunk/src/insserv/debian/check-initd-order
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/check-initd-order?rev=366&op=diff
==============================================================================
--- trunk/src/insserv/debian/check-initd-order (original)
+++ trunk/src/insserv/debian/check-initd-order Mon Dec 31 12:01:35 2007
@@ -126,6 +126,20 @@
             print "\"$pkg\" -> \"$provides[0]\"[color=springgreen] ;\n";
         }
     }
+
+    if ($opts{'k'}) {
+        $key = 'stop-after';
+    } else {
+        $key = 'start-before';
+    }
+
+    if (exists $lsbinfo{$key} && $lsbinfo{$key}) {
+        my @depends = split(/\s+/, $lsbinfo{$key});
+        for my $pkg (@depends) {
+            print "\"$provides[0]\" -> \"$pkg\"[color=yellow] ;\n";
+        }
+    }
+
     print "\"$provides[0]\" [shape=box];\n";
 }
 
@@ -280,6 +294,7 @@
     }
     my $found = 0;
     my ($provides, $requiredstart, $requiredstop, $shouldstart, $shouldstop);
+    my ($startbefore, $stopafter);
     while (<FILE>) {
         chomp;
         $found = 1 if (m/\#\#\# BEGIN INIT INFO/);
@@ -291,6 +306,8 @@
         $requiredstop = $1  if (m/^\# required-stop:\s+(\S*.*\S+)\s*$/i);
         $shouldstart = $1   if (m/^\# should-start:\s+(\S*.*\S+)\s*$/i);
         $shouldstop = $1    if (m/^\# should-stop:\s+(\S*.*\S+)\s*$/i);
+        $startbefore = $1   if (m/^\# X-Start-Before:\s+(\S*.*\S+)\s*$/i);
+        $stopafter = $1     if (m/^\# X-Stop-After:\s+(\S*.*\S+)\s*$/i);
     }
     close(FILE);
 
@@ -303,6 +320,8 @@
             'required-stop'  => $requiredstop,
             'should-start'   => $shouldstart,
             'should-stop'    => $shouldstop,
+            'start-before'   => $startbefore,
+            'stop-after'     => $stopafter,
             'file'           => $file,
             };
 }




More information about the Initscripts-ng-commits mailing list