pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Generally warn about the use of...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bef395cda54f
branches:  trunk
changeset: 498373:bef395cda54f
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Aug 21 10:20:13 2005 +0000

description:
Generally warn about the use of the := operator in Makefiles.

diffstat:

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

diffs (36 lines):

diff -r cdb51759d33c -r bef395cda54f pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Aug 21 08:55:52 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Aug 21 10:20:13 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.249 2005/08/21 08:55:52 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.250 2005/08/21 10:20:13 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -360,7 +360,7 @@
 my $regex_unresolved   = qr"\$\{";
 my $regex_url          = qr"^(?:http://|ftp://|#)"; # allow empty URLs
 my $regex_url_directory        = qr"(?:http://|ftp://)\S+/";
-my $regex_varassign    = qr"^([A-Z_a-z0-9.]+)\s*(=|\?=|\+=)\s*(.*)";
+my $regex_varassign    = qr"^([A-Z_a-z0-9.]+)\s*(=|\?=|\+=|:=)\s*(.*)";
 
 # Global variables
 my $pkgdir;
@@ -1297,6 +1297,14 @@
                if ($cont == $opt_contblank + 1) {
                        $line->log_warning("${cont} contiguous blank lines, should be at most ${opt_contblank}.");
                }
+
+               if ($text =~ $regex_varassign) {
+                       my ($varname, $op, $value) = ($1, $2, $3);
+
+                       if ($op eq ":=") {
+                               $line->log_warning("Please use \"=\" instead of \":=\" if possible.");
+                       }
+               }
        }
 
        checklines_trailing_empty_lines($lines);



Home | Main Index | Thread Index | Old Index