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

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sat Jan 19 11:50:32 UTC 2008


Author: pere
Date: Sat Jan 19 11:50:31 2008
New Revision: 541

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=541
Log:
Changed check-initd-order to load virtual facilities from
/etc/insserv.conf (Closes: #459522).

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=541&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sat Jan 19 11:50:31 2008
@@ -3,6 +3,8 @@
   * Allow insserv to be enabled by preseeding by not updating the
     debconf template default from disk in insserv.config unless
     /usr/sbin/update-rc.d-insserv exist.
+  * Changed check-initd-order to load virtual facilities from
+    /etc/insserv.conf (Closes: #459522)
 
  -- Petter Reinholdtsen <pere at debian.org>  Thu, 17 Jan 2008 11:00:21 +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=541&op=diff
==============================================================================
--- trunk/src/insserv/debian/check-initd-order (original)
+++ trunk/src/insserv/debian/check-initd-order Sat Jan 19 11:50:31 2008
@@ -33,33 +33,13 @@
      '6' => 'rc6.d',
      );
 
-# Map packages to system metapackages.  These dependencies should
-# probably be more complex
-my %sysmap =
-    (
-     'network'      => '$network',
-     'networking'   => '$network',
-     'syslog'       => '$syslog',
-     'sysklogd'     => '$syslog',
-     'mountall'     => '$local_fs',
-     'umountfs'     => '$local_fs',
-     'mountnfs'     => '$remote_fs',
-     'mountnfs-bootclean' => '$remote_fs',
-     'umountnfs'    => '$remote_fs',
-     'sendsigs'     => '$remote_fs',
-     'hwclock'      => '$time',
-     'ntpdate'      => '$time',
-     'ntp-server'   => '$time',
-     'named'        => '$named',
-     'dnsmasq'      => '$named',
-     'lwresd'       => '$named',
-     'bind9'        => '$named',
-     'portmap'      => '$portmap',
-     );
+my %sysmap;
 
 my %provideslist;
 my %scriptorder;
 my %opts;
+
+load_sysmap("/etc/insserv.conf");
 
 while($#ARGV >= 0 && ($_ = $ARGV[0]) =~ /^-/) {
         shift @ARGV;
@@ -97,6 +77,26 @@
     my $path = shift;
     $path =~ s%^.*/([^/]+)$%$1%;
     return $path;
+}
+
+# Map packages to system metapackages.  These dependencies should
+# probably be more complex
+sub load_sysmap {
+    my $filename = shift;
+    open(CONF, "<", "$filename") || die "Unable to load $filename";
+    while (<CONF>) {
+        chomp;
+        s/\#.*$//;
+        next if m/^\s*$/;
+        if (m/^(\$\S+)\s+(\S.*\S*)\S*$/) {
+            my $virt = $1;
+            for my $dep (split(/\s+/, $2)) {
+                $dep =~ s/^\+//g;
+                $sysmap{$dep} = $virt;
+            }
+        }
+    }
+    close(CONF);
 }
 
 sub graph_addnode {




More information about the Initscripts-ng-commits mailing list