summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorrillig <rillig>2006-02-26 16:21:14 +0000
committerrillig <rillig>2006-02-26 16:21:14 +0000
commitae7192e82c84249e22ce05ca6a38c35a61625388 (patch)
tree2e9d1b9edc24ca54210255e30e5ceb3ebfc9d746 /pkgtools/pkglint
parente479691f4366cc82d00c0f1d057aa5cbc0df475e (diff)
downloadpkgsrc-ae7192e82c84249e22ce05ca6a38c35a61625388.tar.gz
- Got rid of 810 warnings in -Wall mode by assuming that certain variables
like *DIR, *PATH, *FILE, PKGNAME will never contain one of the $\"'` characters. With greetings to Alistair, who convinced me that pkglint need not be the most pedantic tool. (It will stay _very_ pedantic, though. :))
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl10
1 files changed, 4 insertions, 6 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index aede655c4e1..4a47dd617ff 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.533 2006/02/26 04:26:52 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.534 2006/02/26 16:21:14 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -2428,11 +2428,9 @@ sub checkline_mk_shellword($$$) {
if ($state == SWST_PLAIN && defined($mod) && $mod =~ qr":Q$") {
# Fine.
- } elsif ($state == SWST_SQUOT && $varname =~ qr"^(?:.*DIRS?|.*FILES?|.*PATH|PREFIX|LOCALBASE|PKGNAME)$") {
- # Fine, too.
-
- } elsif ($state == SWST_DQUOT && $varname =~ qr"^(?:.*_VAR|PKGNAME)$") {
- # Some variables may even be used in double quotes.
+ } elsif (($state == SWST_SQUOT || $state == SWST_DQUOT) && $varname =~ qr"^(?:.*DIR|.*FILE|.*PATH|.*_VAR|PREFIX|LOCALBASE|PKGNAME)$") {
+ # This is ok if we don't allow these
+ # variables to have embedded [\$\\\"\'\`].
} elsif ($state == SWST_DQUOT && defined($mod) && $mod =~ qr":Q$") {
$line->log_warning("Please don't use the :Q operator in double quotes.");