pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint The readmakefile() subroutine only re...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a63d807390d5
branches: trunk
changeset: 503118:a63d807390d5
user: rillig <rillig%pkgsrc.org@localhost>
date: Mon Nov 14 12:32:58 2005 +0000
description:
The readmakefile() subroutine only returns the lines of the main Makefile
in the $all_lines parameter, but the whole text of the included files in
the $whole parameter.
This change avoids duplicate diagnostics for *.mk and Makefile* in the
package directory. A side effect is that package authors only get the
diagnostics they can probably fix, as diagnostics from included files are
not given.
diffstat:
pkgtools/pkglint/TODO | 1 -
pkgtools/pkglint/files/pkglint.pl | 11 ++++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
diffs (44 lines):
diff -r 8ab4676fc89c -r a63d807390d5 pkgtools/pkglint/TODO
--- a/pkgtools/pkglint/TODO Mon Nov 14 11:47:07 2005 +0000
+++ b/pkgtools/pkglint/TODO Mon Nov 14 12:32:58 2005 +0000
@@ -17,4 +17,3 @@
${WRKSRC}. When that is finished, add a warning that using ${XARGS}
is insecure.
* detect spelling errors (like CONFLICT => CONFLICTS)
-* avoid duplicate warnings.
diff -r 8ab4676fc89c -r a63d807390d5 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Mon Nov 14 11:47:07 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Mon Nov 14 12:32:58 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.354 2005/11/14 11:45:52 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.355 2005/11/14 12:32:58 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -1302,16 +1302,21 @@
sub readmakefile($$$) {
my ($file, $all_lines, $seen_Makefile_include) = @_;
my $contents = "";
- my ($includefile, $dirname, $lines);
+ my ($includefile, $dirname, $lines, $is_main_Makefile);
$lines = load_lines($file, true);
if (!$lines) {
return false;
}
+
+ $is_main_Makefile = (@{$all_lines} == 0);
+
foreach my $line (@{$lines}) {
my $text = $line->text;
- push(@{$all_lines}, $line);
+ if ($is_main_Makefile) {
+ push(@{$all_lines}, $line);
+ }
# try to get any included file
my $is_include_line = false;
Home |
Main Index |
Thread Index |
Old Index