summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2006-02-13 15:20:22 +0000
committerrillig <rillig>2006-02-13 15:20:22 +0000
commit1d80638e3b8950aaa6502968c8bc7091f5c89b30 (patch)
treea16f9dd3c40c8cf6670ef80118c1665d36b45736 /pkgtools
parent7fb2dfa6b275366b2442965f78bb02c340aa51dc (diff)
downloadpkgsrc-1d80638e3b8950aaa6502968c8bc7091f5c89b30.tar.gz
- Even if the type of a variable is guessed based on its name, report it
as untyped when in --debug mode. This allows the --debug mode to be used for detecting spelling mistakes.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 64807ae2dd0..a4e9723efe4 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.512 2006/02/12 12:10:13 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.513 2006/02/13 15:20:22 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -3100,7 +3100,7 @@ sub checkline_mk_vartype_basic($$$$$$) {
sub checkline_mk_vartype($$$$$) {
my ($line, $varname, $op, $value, $comment) = @_;
- my ($vartypes);
+ my ($vartypes, $guessed);
return unless $opt_warn_types;
@@ -3116,6 +3116,7 @@ sub checkline_mk_vartype($$$$$) {
}
}
+ $guessed = false;
if (!defined($type)) {
# Guess the datatype of the variable based on
# naming conventions.
@@ -3133,11 +3134,12 @@ sub checkline_mk_vartype($$$$$) {
if (defined($type)) {
$line->log_info("The guessed type of ${varname} is \"${type}\".");
}
+ $guessed = true;
}
- if (!defined($type)) {
+ if (!defined($type) || $guessed) {
if ($varname !~ qr"_MK$") {
- $opt_debug and $line->log_warning("[checkline_mk_vartype] Unchecked variable ${varname}.");
+ $opt_debug and $line->log_warning("[checkline_mk_vartype] Untyped variable ${varname}.");
}
} elsif ($op eq "!=") {