pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files All variables named by SUBST_VA...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c5dc5cf01ea1
branches:  trunk
changeset: 533247:c5dc5cf01ea1
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Sep 11 22:01:18 2007 +0000

description:
All variables named by SUBST_VARS.* are marked as being used.

Quoting warnings are only printed when -Wquoting is enabled.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 1ccd97bac8d7 -r c5dc5cf01ea1 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue Sep 11 21:21:33 2007 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue Sep 11 22:01:18 2007 +0000
@@ -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 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 @@
                }
        }
 
-       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



Home | Main Index | Thread Index | Old Index