pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Added a command line option -Ce...
details: https://anonhg.NetBSD.org/pkgsrc/rev/570b54063ed8
branches: trunk
changeset: 494607:570b54063ed8
user: rillig <rillig%pkgsrc.org@localhost>
date: Thu May 26 06:50:09 2005 +0000
description:
Added a command line option -Cexpensive, which enables more expensive
checks. Currently the effects are that buildlink3.mk files are read in.
Moved around code in checklines_direct_tools to allow $regex_tools to be
used in the list of legitimate shell commands. Added a new rule that
legitimates tool names inside double quotes.
diffstat:
pkgtools/pkglint/files/pkglint.pl | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
diffs (85 lines):
diff -r 5f2e6881fe8e -r 570b54063ed8 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu May 26 06:28:19 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu May 26 06:50:09 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.186 2005/05/26 06:26:10 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.187 2005/05/26 06:50:09 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -300,12 +300,14 @@
my $opt_check_distinfo = true;
my $opt_check_extra = true;
+my $opt_check_expensive = false;
my $opt_check_MESSAGE = true;
my $opt_check_patches = true;
my $opt_check_PLIST = true;
my $opt_check_newpkg = false;
my (%checks) = (
"distinfo" => [\$opt_check_distinfo, "check distinfo file"],
+ "expensive" => [\$opt_check_expensive, "enable warnings that may require much time"],
"extra" => [\$opt_check_extra, "check various additional files"],
"MESSAGE" => [\$opt_check_MESSAGE, "check MESSAGE files"],
"patches" => [\$opt_check_patches, "check patches"],
@@ -1094,11 +1096,15 @@
if ($includefile =~ /\"([^\"]+)\"/) {
$includefile = $1;
}
- if (exists($seen_Makefile_include{$includefile})
- || $includefile =~ qr"/buildlink3.mk$") {
+ if (exists($seen_Makefile_include{$includefile})) {
$contents .= "### pkglint ### skipped $includefile\n";
next;
}
+ if (!$opt_check_expensive && $includefile =~ qr"/buildlink3.mk$") {
+ $contents .= "### pkglint ### skipped $includefile\n";
+ next;
+ }
+
$seen_Makefile_include{$includefile} = true;
if ($includefile =~ qr"Makefile\.common$") {
$seen_Makefile_common = true;
@@ -1234,6 +1240,9 @@
xmkmf);
my @cmd_tools = qw(
file gunzip gzip);
+ my $tools = join("|", @tools, @cmd_tools);
+ my $regex_tools = qr"(?:^|\s|/)(${tools})(?:\s|$)";
+
my @ok_vars = qw(
BUILDLINK_TRANSFORM BUILD_DEPENDS
COMMENT CONFLICTS
@@ -1245,9 +1254,9 @@
SUBST_MESSAGE\\..*
.*_TARGET
USE_TOOLS);
- my @ok_shellcmds = qw(
- \\./Build\s+(?:install|test)
- );
+ my @ok_shellcmds = (
+ qr"\./Build\s+(?:install|test)",
+ qr"\"[^\"]*${regex_tools}[^\"]*\"");
my %toolvar = ();
foreach my $tool (@tools) {
@@ -1257,14 +1266,12 @@
$toolvar{$tool} = uc($tool)."_CMD";
}
- my $tools = join("|", @tools, @cmd_tools);
- my $regex_tools = qr"(?:^|\s|/)(${tools})(?:\s|$)";
- log_info(NO_FILE, NO_LINE_NUMBER, "[checklines_direct_tools] regex_tools=${regex_tools}");
my $ok_vars = join("|", @ok_vars);
my $regex_ok_vars = qr"^(?:${ok_vars})$";
- log_info(NO_FILE, NO_LINE_NUMBER, "[checklines_direct_tools] regex_ok_vars=${regex_ok_vars}");
my $ok_shellcmds = join("|", @ok_shellcmds);
my $regex_ok_shellcmds = qr"(?:${ok_shellcmds})";
+ log_info(NO_FILE, NO_LINE_NUMBER, "[checklines_direct_tools] regex_tools=${regex_tools}");
+ log_info(NO_FILE, NO_LINE_NUMBER, "[checklines_direct_tools] regex_ok_vars=${regex_ok_vars}");
log_info(NO_FILE, NO_LINE_NUMBER, "[checklines_direct_tools] regex_ok_shellcmds=${regex_ok_shellcmds}");
foreach my $line (@{$lines}) {
Home |
Main Index |
Thread Index |
Old Index