summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-08-21 10:20:13 +0000
committerrillig <rillig>2005-08-21 10:20:13 +0000
commit96c1c37825fe36191ee69e4fa68e70a2c043eae7 (patch)
treee131d0b88e8f2e50c3d2ba3077d54a8d5cc783b8 /pkgtools
parent4816ab9bbfc6d2acfcdfcc1722cff28e3ded4cc0 (diff)
downloadpkgsrc-96c1c37825fe36191ee69e4fa68e70a2c043eae7.tar.gz
Generally warn about the use of the := operator in Makefiles.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 3b184c7e940..0841521026e 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -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_pkgname = qr"^((?:[\w.+]|-[^\d])+)-(\d(?:\w|\.\d)*)$";
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 @@ sub checklines_Makefile($) {
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);