summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-08-21 23:05:01 +0000
committerrillig <rillig>2005-08-21 23:05:01 +0000
commit329687e1476ee320dd8dd0125b2531cee75dff54 (patch)
tree2778eee1b7f25a1f151d7f82d3106533e11e2ee9 /pkgtools
parent7af71d88db8bfb8f11e1217fbeff4ce8a6f94ff9 (diff)
downloadpkgsrc-329687e1476ee320dd8dd0125b2531cee75dff54.tar.gz
Reduced the number of warnings for replacing ":=" with "=". Added a command
line flag -Winternal to enable checking of the pkgsrc infrastructure files. By default these files are not checked.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 84c7e7d90da..3df4b295b43 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.252 2005/08/21 18:25:27 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.253 2005/08/21 23:05:01 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -343,6 +343,7 @@ my (%checks) = (
my $opt_warn_absname = true;
my $opt_warn_directcmd = true;
my $opt_warn_exec = true;
+my $opt_warn_internal = false;
my $opt_warn_order = true;
my $opt_warn_paren = true;
my $opt_warn_plist_sort = false;
@@ -353,6 +354,7 @@ my (%warnings) = (
"absname" => [\$opt_warn_absname, "warn about use of absolute file names"],
"directcmd" => [\$opt_warn_directcmd, "warn about use of direct command names instead of Make variables"],
"exec" => [\$opt_warn_exec, "warn if source files are executable"],
+ "internal" => [\$opt_warn_internal, "emit warnings for the pkgsrc infrastructure files"],
"order" => [\$opt_warn_order, "warn if Makefile entries are unordered"],
"paren" => [\$opt_warn_paren, "warn about use of \$(VAR) instead of \${VAR} in Makefiles"],
"plist-sort" => [\$opt_warn_plist_sort, "warn about unsorted entries in PLISTs"],
@@ -1323,8 +1325,13 @@ sub checklines_Makefile($) {
if ($text =~ $regex_varassign) {
my ($varname, $op, $value) = ($1, $2, $3);
- if ($op eq ":=" && !($line->file =~ qr"buildlink3.mk$" && $varname =~ "BUILDLINK")) {
- $line->log_warning("Please use \"=\" instead of \":=\" if possible.");
+ if ($op eq ":=") {
+ if ($line->file =~ qr"buildlink3.mk$" && $varname =~ "BUILDLINK") {
+ # buildlink3 files may use the := operator
+
+ } elsif ($opt_warn_internal || $line->file !~ qr"/mk/") {
+ $line->log_warning("Please use \"=\" instead of \":=\" if possible.");
+ }
}
}
}