pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Variables that are defined by t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/653449e4707a
branches:  trunk
changeset: 395987:653449e4707a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Jul 17 04:39:33 2009 +0000

description:
Variables that are defined by the package may be used as shell commands.

diffstat:

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

diffs (22 lines):

diff -r 30e7dab13189 -r 653449e4707a pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Jul 17 04:21:27 2009 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Fri Jul 17 04:39:33 2009 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.813 2009/06/13 06:30:25 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.814 2009/07/17 04:39:33 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -4483,6 +4483,11 @@
                        } elsif ($shellword =~ m"^\$\{([\w_]+)\}$" && defined($type = get_variable_type($line, $1)) && $type->basic_type eq "ShellCommand") {
                                checkline_mk_shellcmd_use($line, $shellword);
 
+                       } elsif ($shellword =~ m"^\$\{(\w+)\}$" && defined($pkgctx_vardef) && exists($pkgctx_vardef->{$1})) {
+                               # When the package author has explicitly
+                               # defined a command variable, assume it
+                               # to be valid.
+
                        } elsif ($shellword =~ m"^(?:\(|\)|:|;|;;|&&|\|\||\{|\}|break|case|cd|continue|do|done|elif|else|esac|eval|exec|exit|export|fi|for|if|read|set|shift|then|umask|unset|while)$") 
{
                                # Shell builtins are fine.
 



Home | Main Index | Thread Index | Old Index