diff options
author | rillig <rillig@pkgsrc.org> | 2007-04-15 22:58:49 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-04-15 22:58:49 +0000 |
commit | a61cc5dc8aeb07779a76db7167f807ee65a2f682 (patch) | |
tree | ae241d1d47759b0683630bfb72304744c9f2e40b /pkgtools/pkglint | |
parent | 93a3f8db5dff677dbf782268b28b54a523b2a252 (diff) | |
download | pkgsrc-a61cc5dc8aeb07779a76db7167f807ee65a2f682.tar.gz |
Removed the "Internal pkglint errors" when parsing complicated Make
variable expressions. These expressions are skipped completely and not
checked for anything.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 34161f10664..8c220896763 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.704 2007/03/24 05:36:20 schmonz Exp $ +# $NetBSD: pkglint.pl,v 1.705 2007/04/15 22:58:49 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -4171,6 +4171,24 @@ sub checkline_mk_shellword($$$) { checkline_mk_varuse($line, $varname, defined($mod) ? $mod : "", $ctx); } + # The syntax of the variable modifiers can get quite + # hairy. In lack of motivation, we just skip anything + # complicated, hoping that at least the braces are + # balanced. + } elsif ($rest =~ s/^\$\{//) { + my $braces = 1; + while ($rest ne "" && $braces > 0) { + if ($rest =~ s/^\}//) { + $braces--; + } elsif ($rest =~ s/^\{//) { + $braces++; + } elsif ($rest =~ s/^[^{}]+//) { + # Nothing to do here. + } else { + last; + } + } + } elsif ($state == SWST_PLAIN) { if ($rest =~ s/^[!#\%&\(\)*+,\-.\/0-9:;<=>?\@A-Z\[\]^_a-z{|}~]+//) { } elsif ($rest =~ s/^\'//) { |