pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Fixed the parser for shell comm...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4424ccb77b24
branches:  trunk
changeset: 562383:4424ccb77b24
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Jul 26 21:03:19 2009 +0000

description:
Fixed the parser for shell commands, so that it recognizes the $$$$
variable.

diffstat:

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

diffs (28 lines):

diff -r a6b5741482fa -r 4424ccb77b24 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Jul 26 20:20:51 2009 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Jul 26 21:03:19 2009 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.818 2009/07/26 19:30:33 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.819 2009/07/26 21:03:19 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -1374,6 +1374,7 @@
        |       \$[/\@<^]               # special make(1) variables
        |       \$\$[0-9A-Z_a-z]+       # shell variable
        |       \$\$[\#?@]              # special shell variables
+       |       \$\$\$\$                # the special pid shell variable
        |       \$\$\{[0-9A-Z_a-z]+\}   # shell variable in braces
        |       \$\$\(                  # POSIX-style backticks replacement
        |       [^\(\)'\"\\\s;&\|<>\`\$] # non-special character
@@ -4204,7 +4205,8 @@
                                $state = SWST_BACKT;
                        } elsif ($rest =~ s/^\\(?:[ !"#'\(\)*;?\\^{|}]|\$\$)//) {
                        } elsif ($rest =~ s/^\$\$([0-9A-Z_a-z]+|\#)//
-                           || $rest =~ s/^\$\$\{([0-9A-Z_a-z]+|\#)\}//) {
+                           || $rest =~ s/^\$\$\{([0-9A-Z_a-z]+|\#)\}//
+                           || $rest =~ s/^\$\$(\$)\$//) {
                                my ($shvarname) = ($1);
                                if ($opt_warn_quoting && $check_quoting) {
                                        $line->log_warning("Unquoted shell variable \"${shvarname}\".");



Home | Main Index | Thread Index | Old Index