diff options
author | rillig <rillig@pkgsrc.org> | 2006-02-26 16:21:14 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-02-26 16:21:14 +0000 |
commit | 88319d49db916afd8d0521cec758f871de1bc840 (patch) | |
tree | 2e9d1b9edc24ca54210255e30e5ceb3ebfc9d746 /pkgtools/pkglint | |
parent | 94b25968676e239edfc44a252c42643f6841673b (diff) | |
download | pkgsrc-88319d49db916afd8d0521cec758f871de1bc840.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.pl | 10 |
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."); |