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

[SCM] Debian package checker branch, master, updated. 2.5.3-43-gf183a17



The following commit has been merged in the master branch:
commit f183a178adbd06e1df163fbe37f8a6274d781bd4
Author: Jakub Wilk <jwilk@debian.org>
Date:   Sun Oct 2 16:54:44 2011 +0200

    Properly handle continuation lines in debian/rules
    
    Acked-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/debhelper b/checks/debhelper
index 477da07..5decf56 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -85,6 +85,9 @@ my $bdepends;
 open(RULES, '<', "$droot/rules") or fail("cannot read debian/rules: $!");
 
 while (<RULES>) {
+    while (s,\\$,, and defined (my $cont = <RULES>)) {
+        $_ .= $cont;
+    }
     if (/^ifn?(?:eq|def)\s/) {
         $maybe_skipping++;
     } elsif (/^endif\s/) {
@@ -122,7 +125,7 @@ while (<RULES>) {
             if ($dhcommand eq 'dh_scrollkeeper') {
                 tag 'dh_scrollkeeper-is-deprecated', "line $.";
             }
-            if ($dhcommand eq 'dh_clean' and m/\s+\-k(?:\s+.*)?$/) {
+            if ($dhcommand eq 'dh_clean' and m/\s+\-k(?:\s+.*)?$/s) {
                 $seendhcleank = 1;
             }
         }
diff --git a/checks/rules b/checks/rules
index f746279..3dbd262 100644
--- a/checks/rules
+++ b/checks/rules
@@ -155,6 +155,9 @@ my $maybe_skipping;
 my $uses_makefile_pl = 0;
 my %variables;
 while (<RULES>) {
+    while (s,\\$,, and defined (my $cont = <RULES>)) {
+        $_ .= $cont;
+    }
     next if /^\s*\#/;
     if (m/^\s*[s-]?include\s+(\S++)/o){
         my $makefile = $1;
@@ -184,8 +187,8 @@ while (<RULES>) {
     if (/\$[\(\{]PWD[\)\}]/) {
         tag 'debian-rules-uses-pwd', "line $.";
     }
-    if (m/^\t\s*-(?:\$[\(\{]MAKE[\}\)]|make)\s.*(?:dist)?clean/ ||
-        m/^\t\s*(?:\$[\(\{]MAKE[\}\)]|make)\s(?:.*\s)?-\w*i.*(?:dist)?clean/) {
+    if (m/^\t\s*-(?:\$[\(\{]MAKE[\}\)]|make)\s.*(?:dist)?clean/s ||
+        m/^\t\s*(?:\$[\(\{]MAKE[\}\)]|make)\s(?:.*\s)?-\w*i.*(?:dist)?clean/s) {
         tag 'debian-rules-ignores-make-clean-error', "line $.";
     }
     if (/\$[\(\{]DEB_BUILD_OPTS[\)\}]/) {
@@ -197,12 +200,12 @@ while (<RULES>) {
     if (m/\bDEB_[^_ \t]+FLAGS_(?:SET|APPEND)\b/o) {
         tag 'debian-rules-uses-or-modifies-user-only-variable', "line $.";
     }
-    if ($uses_makefile_pl && m/install.*PREFIX/ && !/DESTDIR/) {
+    if ($uses_makefile_pl && m/install.*PREFIX/s && !/DESTDIR/) {
         tag 'debian-rules-makemaker-prefix-is-deprecated', "line $.";
     }
 
     # General assignment - save the variable
-    if (/^\s*(?:\S+\s+)*?(\S+)\s*([:\?\+])?=\s*(.*+)?$/o) {
+    if (/^\s*(?:\S+\s+)*?(\S+)\s*([:\?\+])?=\s*(.*+)?$/so) {
         # This is far too simple from a theoretical PoV, but should do
         # rather well.
         my ($var, $atype, $value) = ($1, $2, $3);
@@ -233,7 +236,7 @@ while (<RULES>) {
     # Listing a rule as a dependency of .PHONY is sufficient to make it
     # present for the purposes of GNU make and therefore the Policy
     # requirement.
-    if (/^(?:[^:]+\s)?\.PHONY(?:\s[^:]+)?:(.+)/) {
+    if (/^(?:[^:]+\s)?\.PHONY(?:\s[^:]+)?:(.+)/s) {
         my @targets = split (' ', $1);
         local $_;
         for (@targets) {
@@ -260,13 +263,13 @@ while (<RULES>) {
         next; #.PHONY implies the rest will not match
     }
 
-    if (!/^ifn?(?:eq|def)\s/ && m/^([^\s:][^:]*):+(.*)/) {
+    if (!/^ifn?(?:eq|def)\s/ && m/^([^\s:][^:]*):+(.*)/s) {
         @current_targets = split (' ', $1);
         my @depends = map {
             $_ = quotemeta $_;
             s/\\\$\\\([^\):]+\\:([^=]+)\\=([^\)]+)\1\\\)/$2.*/g;
             qr/^$_$/;
-        } split (m/ /o, $2);
+        } split (' ', $2);
         for my $target (@current_targets) {
             if ($target =~ m/%/o) {
                 my $pattern = quotemeta $target;
diff --git a/debian/changelog b/debian/changelog
index 5dca0c8..c922359 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,7 @@ lintian (2.5.4) UNRELEASED; urgency=low
       (Closes: #641035)
     + [JW] Detect missing dependencies for using dh sequences.
       (Closes: #613327)
+    + [JW] Parse continuation lines in d/rules.
   * checks/files{,.desc}:
     + [JW] Suggest the usage of "-delete" rather than "| xargs rm -f".
       (Closes: #641983)
@@ -30,6 +31,7 @@ lintian (2.5.4) UNRELEASED; urgency=low
       "dh --with=X" rather than "dh --with X".  (Closes: #643714)
     + [NT] Do not emit missing-build-dependency for missing dh sequences,
       since the new tag will handle those.
+    + [JW] Parse continuation lines in d/rules.  (Closes: #644021)
   * checks/scripts:
     + [RA] Exclude files ending in *.erb from several shell script
       checks.  ERB is a Ruby templating language, so these will probably

-- 
Debian package checker


Reply to: