diff options
author | rillig <rillig> | 2009-07-17 04:39:33 +0000 |
---|---|---|
committer | rillig <rillig> | 2009-07-17 04:39:33 +0000 |
commit | c227e3a72a0a9bfecfe20237b682bf64d2508b74 (patch) | |
tree | b1f451765bd5432b3bd2b85e2d107bd3dd499974 /pkgtools/pkglint | |
parent | 76ec20b4eb2cc6c2cd7ff45001e625cd7ceb964b (diff) | |
download | pkgsrc-c227e3a72a0a9bfecfe20237b682bf64d2508b74.tar.gz |
Variables that are defined by the package may be used as shell commands.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 9deb79ed14c..52b78cabc4a 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -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 @@ sub checkline_mk_shelltext($$) { } 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. |