pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Got rid of 810 warnings in -W...
details: https://anonhg.NetBSD.org/pkgsrc/rev/50dff98334da
branches: trunk
changeset: 508837:50dff98334da
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun Feb 26 16:21:14 2006 +0000
description:
- 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:
pkgtools/pkglint/files/pkglint.pl | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diffs (25 lines):
diff -r 8b70307767ba -r 50dff98334da pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Feb 26 16:04:23 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Feb 26 16:21:14 2006 +0000
@@ -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 @@
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.");
Home |
Main Index |
Thread Index |
Old Index