[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, wheezy, updated. 2.5.10.3-5-g54bac3d



The following commit has been merged in the wheezy branch:
commit 34af1a42308fb2cb5bc6e214466982723f435e70
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jan 21 16:51:07 2013 +0100

    c/init.d: Fix init.d regex
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/init.d b/checks/init.d
index 99d6958..86d9985 100644
--- a/checks/init.d
+++ b/checks/init.d
@@ -61,6 +61,11 @@ my %implied_dependencies =
     );
 
 our $VIRTUAL_FACILITIES = Lintian::Data->new('init.d/virtual_facilities');
+# Regex to match names of init.d scripts; it is a bit more lax than
+# package names (e.g. allows "_").  We do not allow it to start with a
+# "dash" to avoid confusing it with a command-line option (also,
+# update-rc.d does not allow this).
+our $INITD_NAME_REGEX = qr/[\w\.\+][\w\-\.\+]*/;
 
 sub run {
 
@@ -88,7 +93,7 @@ if (open(IN, '<', $postinst)) {
         next if /$exclude_r/o;
         s/\#.*$//o;
         next unless /^(?:.+;|^\s*system[\s\(\']+)?\s*update-rc\.d\s+
-            (?:$opts_r)*($PKGNAME_REGEX)\s+($action_r)/xo;
+            (?:$opts_r)*($INITD_NAME_REGEX)\s+($action_r)/xo;
         my ($name,$opt) = ($1,$2);
         next if $opt eq 'remove';
         if ($initd_postinst{$name}++ == 1) {
@@ -108,7 +113,7 @@ if (open(IN, '<', $preinst)) {
         next if /$exclude_r/o;
         s/\#.*$//o;
         next unless m/update-rc\.d \s+
-                       (?:$opts_r)*($PKGNAME_REGEX) \s+
+                       (?:$opts_r)*($INITD_NAME_REGEX) \s+
                        ($action_r)/ox;
         my ($name,$opt) = ($1,$2);
         next if $opt eq 'remove';
@@ -122,7 +127,7 @@ if (open(IN, '<', $postrm)) {
     while (<IN>) {
         next if /$exclude_r/o;
         s/\#.*$//o;
-        next unless m/update-rc\.d\s+($opts_r)*($PKGNAME_REGEX)/o;
+        next unless m/update-rc\.d\s+($opts_r)*($INITD_NAME_REGEX)/o;
         if ($initd_postrm{$2}++ == 1) {
             tag 'duplicate-updaterc.d-calls-in-postrm', $2;
             next;
@@ -139,7 +144,7 @@ if (open(IN, '<', $prerm)) {
     while (<IN>) {
         next if /$exclude_r/o;
         s/\#.*$//o;
-        next unless m/update-rc\.d\s+($opts_r)*($PKGNAME_REGEX)/o;
+        next unless m/update-rc\.d\s+($opts_r)*($INITD_NAME_REGEX)/o;
         tag 'prerm-calls-updaterc.d', $2;
     }
     close(IN);
diff --git a/debian/changelog b/debian/changelog
index 7defc31..441b2e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
 lintian (2.5.10.4) unstable; urgency=low
 
+  * checks/init.d:
+    + [NT] Fix regression where Lintian would not properly match
+      init.d passed to update-rc.d.  Thanks to Michael Meskes for
+      reporting.  (Closes: #698602)
+
   * lib/Lintian/Collect/Package.pm:
     + [NT] Ensure the "root" entry of indices do not contain itself.
       (Closes: #695866)

-- 
Debian package checker


Reply to: