summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-04-15 22:58:49 +0000
committerrillig <rillig@pkgsrc.org>2007-04-15 22:58:49 +0000
commit77b2375207175a710dceb0753c1bbac5aae6d50f (patch)
treeae241d1d47759b0683630bfb72304744c9f2e40b /pkgtools
parent6dd050be15752d9b7a983f6754b3e7ffa193fc29 (diff)
downloadpkgsrc-77b2375207175a710dceb0753c1bbac5aae6d50f.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')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl20
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/^\'//) {