summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-09-11 22:01:18 +0000
committerrillig <rillig@pkgsrc.org>2007-09-11 22:01:18 +0000
commitef31fba439fbedc55256df714ced95bd095856f8 (patch)
tree4e17df414890b2e0f3c713f3f3ca4acd1957028b /pkgtools
parent554e48737547ca70fd006f44746dd8ca80837126 (diff)
downloadpkgsrc-ef31fba439fbedc55256df714ced95bd095856f8.tar.gz
All variables named by SUBST_VARS.* are marked as being used.
Quoting warnings are only printed when -Wquoting is enabled.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 5840695c55e..84d140e6292 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.717 2007/09/04 09:44:07 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.718 2007/09/11 22:01:18 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -3398,8 +3398,15 @@ sub parseline_mk($) {
sub parselines_mk($) {
my ($lines) = @_;
+ assert(defined($pkgctx_varuse), "pkgctx_varuse must be defined.");
foreach my $line (@{$lines}) {
parseline_mk($line);
+ if ($line->has("is_varassign") && $line->get("varcanon") eq "SUBST_VARS.*") {
+ foreach my $svar (split(/\s+/, $line->get("value"))) {
+ $pkgctx_varuse->{$svar} = true;
+ $opt_debug_misc and $line->log_debug("varuse $svar");
+ }
+ }
}
}
@@ -3962,7 +3969,7 @@ sub checkline_mk_varuse($$$$) {
}
}
- if ($context->shellword != VUC_SHELLWORD_UNKNOWN && $needs_quoting != dont_know) {
+ if ($opt_warn_quoting and $context->shellword != VUC_SHELLWORD_UNKNOWN && $needs_quoting != dont_know) {
# In GNU configure scripts, a few variables need to be
# passed through the :M* operator before they reach the