pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Variable names may contain simp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/14f5338a4aa0
branches:  trunk
changeset: 517996:14f5338a4aa0
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Aug 28 12:41:49 2006 +0000

description:
Variable names may contain simply nested variables. This allows the
shell parser to correctly handle ${WRKSRC.${d}}, which appears for
example in geography/epsg.

Avoided an internal fatal error for files that contain RCS conflicts.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r a965d0d3fd13 -r 14f5338a4aa0 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Aug 28 12:18:00 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Aug 28 12:41:49 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.669 2006/08/04 18:32:41 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.670 2006/08/28 12:41:49 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -1790,6 +1790,7 @@
 use constant regex_mk_shellvaruse => qr"(?:^|[^\$])\$\$\{?(\w+)\}?"; # XXX: not perfect
 use constant regex_pkgname     => qr"^((?:[\w.+]|-[^\d])+)-(\d(?:\w|\.\d)*)$";
 use constant regex_mk_shellcmd => qr"^\t(.*)$";
+use constant regex_rcs_conflict        => qr"^(<<<<<<<|=======|>>>>>>>)";
 use constant regex_unresolved  => qr"\$\{";
 use constant regex_validchars  => qr"[\011\040-\176]";
 # Note: the following regular expression looks more complicated than
@@ -1823,7 +1824,7 @@
        |       [^\(\)'\"\\\s;&\|<>\`\$] # non-special character
        |       \$\{[^\s\"'`]+          # HACK: nested make(1) variables
        )+ | ;;? | &&? | \|\|? | \( | \) | >& | <<? | >>? | \#.*)"sx;
-my $regex_varname              = qr"[-*+.0-9A-Z_a-z{}\[]+";
+my $regex_varname              = qr"(?:[-*+.0-9A-Z_a-z{}\[]+|\$\{[\w_]+\})+";
 my $regex_pkgbase              = qr"(?:[+.0-9A-Z_a-z]|-[A-Z_a-z])+";
 my $regex_pkgversion           = qr"\d(?:\w|\.\d)*";
 
@@ -3304,6 +3305,9 @@
                $line->set("sources", $sources);
                defined($comment) and $line->set("comment", $comment);
 
+       } elsif ($text =~ regex_rcs_conflict) {
+               # This line is useless
+
        } else {
                assert(false, "Unknown line format: " . $line->to_string());
        }



Home | Main Index | Thread Index | Old Index