pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Added SUBST_MESSAGE to the li...
details: https://anonhg.NetBSD.org/pkgsrc/rev/db6f07e3b1a9
branches: trunk
changeset: 505785:db6f07e3b1a9
user: rillig <rillig%pkgsrc.org@localhost>
date: Sat Jan 07 20:00:00 2006 +0000
description:
- Added SUBST_MESSAGE to the list of checked variables. The plan is to
remove the quoting from the definitions in the Makefiles.
- When checking with -Wall, print warnings about possibly misquoted
variables in the various states of the shell word parser.
diffstat:
pkgtools/pkglint/files/makevars.map | 3 ++-
pkgtools/pkglint/files/pkglint.pl | 20 ++++++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
diffs (66 lines):
diff -r 48c0af850cf4 -r db6f07e3b1a9 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map Sat Jan 07 19:51:42 2006 +0000
+++ b/pkgtools/pkglint/files/makevars.map Sat Jan 07 20:00:00 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.52 2006/01/02 01:18:24 rillig Exp $
+# $NetBSD: makevars.map,v 1.53 2006/01/07 20:00:00 rillig Exp $
#
# This file contains the guessed type of some variables, according to
@@ -175,6 +175,7 @@
SCRIPTS_ENV List+ of ShellWord
SUBST_CLASSES List+
SUBST_FILES List of Pathmask
+SUBST_MESSAGE SubstMessage
SUBST_SED List of ShellWord
# ^^ This may be changed to a List+ later.
SUBST_STAGE Stage
diff -r 48c0af850cf4 -r db6f07e3b1a9 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Jan 07 19:51:42 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Jan 07 20:00:00 2006 +0000
@@ -1,5 +1,5 @@
#! @PERL@ -w
-# $NetBSD: pkglint.pl,v 1.453 2006/01/06 21:06:06 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.454 2006/01/07 20:00:00 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -1735,6 +1735,12 @@
"SWST_DQUOT_BACKT", "SWST_BACKT",
"SWST_BACKT_DQUOT", "SWST_BACKT_SQUOT"
];
+ use constant user_statename => [
+ "unquoted string", "single quoted string",
+ "double quoted string", "backticks inside double quoted string",
+ "backticks", "double quoted string inside backticks",
+ "single quoted string inside backticks"
+ ];
$rest = ($shellword =~ qr"^#") ? "" : $shellword;
$state = SWST_PLAIN;
@@ -1748,7 +1754,7 @@
# TODO: Make lists of variables that may appear
# in other quoting states than SWST_PLAIN.
if ($opt_warn_extra && $state != SWST_PLAIN) {
- $line->log_debug("Possibly misquoted make variable \"${varname}\" in " . statename->[$state] . ".");
+ $line->log_warning("Possibly misquoted make variable ${varname} in " . user_statename->[$state] . ".");
}
} elsif ($state == SWST_PLAIN) {
@@ -2225,6 +2231,16 @@
$line->log_warning("Invalid stage name. Use one of {pre,do,post}-{extract,patch,configure,build,install}.");
}
+ } elsif ($type eq "SubstMessage") {
+
+# TODO: Enable this code when there is a :Q operator on the statement
+# that prints the ${SUBST_MESSAGE} in subst.mk.
+if (false) {
+ if ($value =~ qr"^\".*\"$") {
+ $line->log_warning("${varname} should not be quoted.");
+ }
+}
+
} elsif ($type eq "Tool") {
if ($value =~ qr"^([-\w]+|\[)(?::(\w+))?$") {
my ($toolname, $tooldep) = ($1, $2);
Home |
Main Index |
Thread Index |
Old Index