diff options
author | rillig <rillig> | 2005-11-14 12:32:58 +0000 |
---|---|---|
committer | rillig <rillig> | 2005-11-14 12:32:58 +0000 |
commit | 8f0c484a7334be9938a3b6c3c98015940f0ff016 (patch) | |
tree | 688cdd70fcc8f606303c51f2588ef6c00d8b7c9b /pkgtools | |
parent | 6b34e3b799b855fd4e54a468589da27f7e8ed768 (diff) | |
download | pkgsrc-8f0c484a7334be9938a3b6c3c98015940f0ff016.tar.gz |
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 (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/TODO | 1 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pkgtools/pkglint/TODO b/pkgtools/pkglint/TODO index 1d8db6a0714..bcec089ef23 100644 --- a/pkgtools/pkglint/TODO +++ b/pkgtools/pkglint/TODO @@ -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 --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index b2b40c633ac..9a523fe060c 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.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($$$); 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; |