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

Re: Regression in lintian/checks/rules



Colin Watson <cjwatson@debian.org> writes:

> This seems to work around it, but I haven't got my head around exactly
> how that code works yet so I haven't checked it in. In any case, it
> seems as though the right fix would need to involve improving the regex
> above - perhaps excluding opening parentheses before the colon, or
> something like that?

> -            qr/^$_$/;
> +            qr/^\Q$_\E$/;

That change will break handling of make variables in pattern rules, which
is why the change was made originally.

I think this is a better fix:

--- a/checks/rules
+++ b/checks/rules
@@ -247,10 +247,11 @@ while (<RULES>) {
         }
     }
 
-    if (/^([^\s:][^:]*):+(.*)/) {
+    if (!/^ifn?(eq|def)\s/ && /^([^\s:][^:]*):+(.*)/) {
        @current_targets = split (' ', $1);
         my @depends = map {
-            s/\$\([^\):]+:([^=]+)=([^\)]+)\1\)/$2.*/g;
+            $_ = quotemeta $_;
+            s/\\\$\\\([^\):]+\\:([^=]+)\\=([^\)]+)\1\\\)/$2.*/g;
             qr/^$_$/;
         } split (' ', $2);
        for my $target (@current_targets) {

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: