pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Not all possible plural varia...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/910dbf3e7e8b
branches:  trunk
changeset: 503628:910dbf3e7e8b
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Nov 24 08:46:34 2005 +0000

description:
- Not all possible plural variables have to be quoted with
  :M*:Q instead of a simple :Q. Currently only the GNU configure
  scripts need the white-space stripped, so it's enough to quote
  those (see regex_gnu_configure_volatile_vars in the source).

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 7e667f4cec3d -r 910dbf3e7e8b pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Nov 24 08:05:01 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Nov 24 08:46:34 2005 +0000
@@ -11,7 +11,7 @@
 # Freely redistributable.  Absolutely no warranty.
 #
 # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.381 2005/11/24 08:05:01 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.382 2005/11/24 08:46:34 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -700,6 +700,8 @@
 # Commonly used regular expressions.
 #
 
+use constant regex_gnu_configure_volatile_vars
+                               => qr"^(?:CFLAGS||CPPFLAGS|CXXFLAGS|FFLAGS|LDFLAGS|LIBS)$";
 use constant regex_pkgname     => qr"^((?:[\w.+]|-[^\d])+)-(\d(?:\w|\.\d)*)$";
 use constant regex_shellcmd    => qr"^\t(.*)$";
 use constant regex_unresolved  => qr"\$\{";
@@ -1820,14 +1822,12 @@
        } elsif ($type eq "ShellWord") {
                if ($value =~ qr"^[\w_]+=(([\"']?)\$\{([\w_]+)\}\2)$") {
                        my ($vexpr, undef, $vname) = ($1, $2, $3);
-                       # XXX: The following heuristics are too simple (example: OPSYS is not a plural).
-                       my $mod = ($vname =~ get_regex_plurals()) ? ":M*:Q" : ":Q";
+                       my $mod = ($vname =~ regex_gnu_configure_volatile_vars) ? ":M*:Q" : ":Q";
                        $line->log_warning("Please use \${${vname}${mod}} instead of ${vexpr}.");
 
                } elsif ($value =~ qr"^[\w_]+=(\$\{([\w_]+):Q\})$") {
                        my ($vexpr, $vname) = ($1, $2);
-                       # XXX: The following heuristics are too simple (example: OPSYS is not a plural).
-                       if ($vname =~ get_regex_plurals()) {
+                       if ($vname =~ regex_gnu_configure_volatile_vars) {
                                $line->log_warning("Please use \${${vname}:M*:Q} instead of ${vexpr}.");
                        }
                } elsif ($value ne "" && $value !~ qr"^${regex_shellword}$") {



Home | Main Index | Thread Index | Old Index