diff options
author | rillig <rillig> | 2006-07-28 17:10:12 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-07-28 17:10:12 +0000 |
commit | 585c06aef94f0f8516863ddc2fba2a6a2c6609ea (patch) | |
tree | 4bc16e94ef6b49024ad8f2cbe5fbe0d3e9e786b2 /pkgtools | |
parent | feec1dce57c8c9b2e18c95241263e86d2723cab6 (diff) | |
download | pkgsrc-585c06aef94f0f8516863ddc2fba2a6a2c6609ea.tar.gz |
The shell command lines in Makefiles are split into words, which are then
saved in the line as extra fields.
When checking for absolute pathnames in "other" files, allow the form
${variable}/bin, as seen in www/apache2/patches/patch-ad. Noticed by
Matthias Scheler.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index f051195d220..3f44bf9ab4b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.664 2006/07/27 16:13:51 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.665 2006/07/28 17:10:12 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -3256,6 +3256,12 @@ sub parseline_mk($) { $line->set("is_shellcmd", true); $line->set("shellcmd", $shellcmd); + my ($shellwords, $rest) = match_all($shellcmd, $regex_shellword); + $line->set("shellwords", $shellwords); + if ($rest !~ qr"^\s*$") { + $line->set("shellwords_rest", $rest); + } + } elsif ($text =~ regex_mk_comment) { my ($comment) = @_; @@ -3624,6 +3630,9 @@ sub checkline_other_absolute_pathname($$) { if ($before =~ qr"\@$") { # Something like @PREFIX@/bin + } elsif ($before =~ qr"\}$") { + # Something like ${prefix}/bin + } else { checkword_absolute_pathname($line, $path); } |