pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Replaced two instances of ad-ho...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/32e5286ccd40
branches:  trunk
changeset: 498909:32e5286ccd40
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Sep 05 13:27:36 2005 +0000

description:
Replaced two instances of ad-hoc regular expressions with regex_varassign.

diffstat:

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

diffs (32 lines):

diff -r eff1fb0470b3 -r 32e5286ccd40 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Sep 05 13:22:00 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Sep 05 13:27:36 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.279 2005/09/05 13:06:20 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.280 2005/09/05 13:27:36 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -1168,7 +1168,7 @@
 
 sub checkline_Makefile_vartype($$) {
        my ($line, $vartypes) = @_;
-       if ($line->text =~ qr"^([A-Z_a-z0-9.]+)\s*(=|\?=|\+=)\s*(.*)") {
+       if ($line->text =~ $regex_varassign) {
                my ($varname, $op, $value) = ($1, $2, $3);
                if ($value =~ qr"\$") {
                        # ignore values that contain other variables
@@ -1252,8 +1252,8 @@
        }
 
        foreach my $line (@{$lines}) {
-               if ($line->text =~ qr"^([A-Z][A-Z0-9_]*)\s*[!+?]?=") {
-                       my ($varname) = ($1);
+               if ($line->text =~ $regex_varassign) {
+                       my ($varname, undef, undef) = ($1, $2, $3);
                        if (exists($vars{$varname})) {
                                $line->log_warning("${varname} is deprecated. $vars{$varname}");
                        }



Home | Main Index | Thread Index | Old Index