diff options
author | rillig <rillig> | 2006-07-11 12:01:06 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-07-11 12:01:06 +0000 |
commit | c3ae1973e94136a4aface8152c9c2f450c4f0051 (patch) | |
tree | 264475793e56f6817167f92e01fea8df78ca4d6f /pkgtools | |
parent | 7ff5de7d688f7e86f257d72efed717ec83997f24 (diff) | |
download | pkgsrc-c3ae1973e94136a4aface8152c9c2f450c4f0051.tar.gz |
Swapped the order of two checks in variable_needs_quoting. Now lists of
filenames and pathnames may appear in .for loops. (Of course, this only
works for "nice" filenames, but the amount of false positive warnings would
just be too high.)
Added another warning for dependency patterns like 2.3*, which are
likely to be wrong: They match 2.3, 2.3nb4 and 2.30, but not 2.20, which
lies in between them.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 6 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 31 |
2 files changed, 24 insertions, 13 deletions
diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index cd69feafb19..6c80c66ce17 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.127 2006/07/10 04:16:02 rillig Exp $ +# $NetBSD: makevars.map,v 1.128 2006/07/11 12:01:06 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -212,7 +212,7 @@ CONFIGURE_DIRS List of WrksrcSubdirectory [$package_list] CONFIGURE_ENV List of ShellWord [$package_list] CONFIGURE_HAS_INFODIR YesNo [$package] CONFIGURE_HAS_MANDIR YesNo [$package] -CONFIGURE_SCRIPT Pathname [m:s] +CONFIGURE_SCRIPT Pathname [$package] CONFIG_GUESS_OVERRIDE List of Pathmask [m:as,c:as] CONFIG_STATUS_OVERRIDE List of Pathmask [m:as,c:as] CONFIG_SHELL Pathname [m:s,c:s] @@ -447,7 +447,7 @@ OPSYS Identifier [$system] OPSYSVARS List of Varname [m:a,c:a] OSVERSION_SPECIFIC Yes [m:s,c:s] OS_VERSION Version [$system] -OVERRIDE_DIRDEPTH Integer [$package] +OVERRIDE_DIRDEPTH* Integer [$package] OVERRIDE_GNU_CONFIG_SCRIPTS Yes [$package] OWN_DIRS List of Pathname [$package_list] OWN_DIRS_PERMS List of ShellWord [$package_list] diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 9c4f260e5ad..03bdf320665 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.643 2006/07/10 11:19:23 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.644 2006/07/11 12:01:06 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -3033,13 +3033,6 @@ sub variable_needs_quoting($$$) { return dont_know; } - # In .for loops, the :Q operator is always misplaced, since - # the items are broken up at white-space, not as shell words - # like in all other parts of make(1). - if ($context->shellword == VUC_SHELLWORD_FOR) { - return false; - } - # Variables of certain predefined types, as well as all # enumerations, are expected to not require the :Q operator. if (ref($type->basic_type) eq "HASH" || exists(safe_types->{$type->basic_type})) { @@ -3051,6 +3044,13 @@ sub variable_needs_quoting($$$) { } } + # In .for loops, the :Q operator is always misplaced, since + # the items are broken up at white-space, not as shell words + # like in all other parts of make(1). + if ($context->shellword == VUC_SHELLWORD_FOR) { + return false; + } + # Determine whether the context expects a list of shell words or # not. $want_list = $context->type->is_practically_a_list() && ($context->shellword == VUC_SHELLWORD_BACKT || $context->extent != VUC_EXTENT_WORD_PART); @@ -4424,8 +4424,19 @@ sub checkline_mk_vartype_basic($$$$$$$$) { "packages that have the same prefix, but a longer name. For example,", "foo-* matches foo-1.2, but also foo-client-1.2 and foo-server-1.2."); - } elsif ($depversion ne "[0-9]*" && $depversion =~ qr"^\[.*\]$") { - $line->log_warning("Only [0-9]* is allowed in the numeric part of a dependency."); + } elsif ($depversion =~ qr"^\[.*\]$") { + if ($depversion ne "[0-9]*") { + $line->log_warning("Only [0-9]* is allowed in the numeric part of a dependency."); + } + + } elsif ($depversion !~ qr"\[" && $depversion !~ qr"\.\*$") { + $line->log_warning("Error-prone dependency pattern \"${depversion}\"."); + $line->explain_warning( + "Instead of 3*, you should either write write 3{,nb*} or 3.* if you", + "meant that. Otherwise, maybe you meant \"package>=3\"?"); + + } else { + # Great. } } elsif ($value =~ qr"\{") { |