pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Reworked the way that .include ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/30a51d06c35e
branches: trunk
changeset: 516203:30a51d06c35e
user: rillig <rillig%pkgsrc.org@localhost>
date: Mon Jul 17 12:56:01 2006 +0000
description:
Reworked the way that .include lines are parsed, in order to get the
recent buildlink3 check correct.
A buildlink3 file that appears in the package but not in the
buildlink3.mk file is not worth a warning, since there are legitimate
reasons for doing this, which is also documented in the buildlink3
documentation.
diffstat:
pkgtools/pkglint/files/pkglint.pl | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diffs (67 lines):
diff -r 5e20496457ce -r 30a51d06c35e pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Jul 17 12:32:00 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Jul 17 12:56:01 2006 +0000
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.652 2006/07/17 11:20:09 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.653 2006/07/17 12:56:01 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -3190,16 +3190,23 @@
$line->log_note("Skipping include file \"${includefile}\". This may result in false warnings.");
}
- } elsif (exists($seen_Makefile_include->{$includefile})) {
- # Don't include any file twice
-
} else {
$is_include_line = true;
- $seen_Makefile_include->{$includefile} = true;
}
}
if ($is_include_line) {
+ if ($fname !~ qr"buildlink3\.mk$" && $includefile =~ qr"^\.\./\.\./(.*)/buildlink3\.mk$") {
+ my ($bl3_file) = ($1);
+
+ $pkgctx_bl3->{$bl3_file} = $line;
+ $opt_debug_misc and $line->log_debug("Buildlink3 file in package: ${bl3_file}");
+ }
+ }
+
+ if ($is_include_line && !exists($seen_Makefile_include->{$includefile})) {
+ $seen_Makefile_include->{$includefile} = true;
+
if ($includefile =~ qr"^\.\./[^./][^/]*/[^/]+") {
$line->log_warning("Relative directories should look like \"../../category/package\", not \"../package\".");
$line->explain_warning(expl_relative_dirs);
@@ -3231,13 +3238,6 @@
}
}
- if ($fname !~ qr"buildlink3\.mk$" && $includefile =~ qr"^\.\./\.\./(.*)/buildlink3\.mk$") {
- my ($bl3_file) = ($1);
-
- $pkgctx_bl3->{$bl3_file} = $line;
- $opt_debug_misc and $line->log_debug("Buildlink3 file in package: ${bl3_file}");
- }
-
} elsif ($text =~ regex_varassign) {
my ($varname, $op, $value, $comment) = ($1, $2, $3, $4);
@@ -5693,11 +5693,11 @@
}
}
- # Print warnings for all buildlink3.mk files that are included
- # by the package but not by this file.
+ # Print debugging messages for all buildlink3.mk files that are
+ # included by the package but not by this buildlink3.mk file.
foreach my $package_bl3 (sort(keys(%{$pkgctx_bl3}))) {
if (!exists($included_files->{$package_bl3})) {
- $pkgctx_bl3->{$package_bl3}->log_warning("${package_bl3}/buildlink3.mk is included by the package but not by the buildlink3.mk file.");
+ $opt_debug_misc and $pkgctx_bl3->{$package_bl3}->log_debug("${package_bl3}/buildlink3.mk is included by the package but not by the buildlink3.mk file.");
}
}
}
Home |
Main Index |
Thread Index |
Old Index