pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Swapped the order of two checks...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b0d7e7fe830c
branches:  trunk
changeset: 515940:b0d7e7fe830c
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jul 11 12:01:06 2006 +0000

description:
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:

 pkgtools/pkglint/files/makevars.map |   6 +++---
 pkgtools/pkglint/files/pkglint.pl   |  31 +++++++++++++++++++++----------
 2 files changed, 24 insertions(+), 13 deletions(-)

diffs (87 lines):

diff -r a800eb063b17 -r b0d7e7fe830c pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Tue Jul 11 10:21:16 2006 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Tue Jul 11 12:01:06 2006 +0000
@@ -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_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 @@
 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 -r a800eb063b17 -r b0d7e7fe830c pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue Jul 11 10:21:16 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue Jul 11 12:01:06 2006 +0000
@@ -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 @@
                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 @@
                }
        }
 
+       # 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 @@
                                        "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"\{") {



Home | Main Index | Thread Index | Old Index