pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Reduced the number of warnings ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/027e7ef4ae9e
branches: trunk
changeset: 498414:027e7ef4ae9e
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun Aug 21 23:05:01 2005 +0000
description:
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:
pkgtools/pkglint/files/pkglint.pl | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (44 lines):
diff -r 995daf372a2c -r 027e7ef4ae9e pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Aug 21 22:29:45 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Aug 21 23:05:01 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.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 $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 @@
"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 @@
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.");
+ }
}
}
}
Home |
Main Index |
Thread Index |
Old Index