diff options
author | rillig <rillig@pkgsrc.org> | 2013-08-31 18:14:28 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2013-08-31 18:14:28 +0000 |
commit | 77d14724916a6d5c69e5fd9ae6783a7411acbc40 (patch) | |
tree | bdcbf93bc0e8fcf31b04bee72d12a98d145a53f5 /pkgtools | |
parent | 767a6865be9f49efbb61807cd4cf7819e63c5877 (diff) | |
download | pkgsrc-77d14724916a6d5c69e5fd9ae6783a7411acbc40.tar.gz |
- When the source line is logged (option -s), an empty line above
helps to see which source line belongs to which warning.
- PKGSRCTOP is a known variable. It is used only in the top-level
Makefile.
- Arbitrary tool names may be added to TOOLS_NOOP.
- In the top-level Makefile, the alphabetic order of the SUBDIRs
may have a single exception.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/PkgLint/Line.pm | 1 | ||||
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 3 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 29 |
3 files changed, 24 insertions, 9 deletions
diff --git a/pkgtools/pkglint/files/PkgLint/Line.pm b/pkgtools/pkglint/files/PkgLint/Line.pm index a4b8e4720ea..8a4f12d9a5a 100644 --- a/pkgtools/pkglint/files/PkgLint/Line.pm +++ b/pkgtools/pkglint/files/PkgLint/Line.pm @@ -90,6 +90,7 @@ sub show_source($$) { my ($self, $out) = @_; if (PkgLint::Logging::get_show_source_flag()) { + print $out ("\n"); foreach my $line (@{$self->physlines}) { print $out ("> " . $line->[1]); } diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index c911acfd734..b288b0214aa 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.236 2013/08/15 20:30:43 rillig Exp $ +# $NetBSD: makevars.map,v 1.237 2013/08/31 18:14:28 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -541,6 +541,7 @@ PKGPATH Pathname [$system] PKGREPOSITORY Unchecked [] PKGREVISION PkgRevision [m:s] PKGSRCDIR Pathname [$system] +PKGSRCTOP Yes [m:s] PKGTOOLS_ENV List of ShellWord PKGVERSION Version [$system] PKGWILDCARD Filemask [$system] diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 6ca9ff650bb..12bcbe1fd8b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.857 2013/08/15 20:30:43 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.858 2013/08/31 18:14:28 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -2527,6 +2527,13 @@ sub checkline_rcsid_regex($$$) { if ($line->text !~ m"^${prefix_regex}\$(${id})(?::[^\$]+|)\$$") { $line->log_error("\"${prefix}\$${opt_rcsidstring}\$\" expected."); + $line->explain_error( +"Several files in pkgsrc must contain the CVS Id, so that their current", +"version can be traced back later from a binary package. This is to", +"ensure reproducible builds, for example for finding bugs.", +"", +"Please insert the text from the above error message (without the quotes)", +"at this position in the file."); return false; } return true; @@ -4399,7 +4406,10 @@ sub checkline_mk_vartype_basic($$$$$$$$) { }, Tool => sub { - if ($value =~ m"^([-\w]+|\[)(?::(\w+))?$") { + if ($varname eq "TOOLS_NOOP" && $op eq "+=") { + # no warning for package-defined tool definitions + + } elsif ($value =~ m"^([-\w]+|\[)(?::(\w+))?$") { my ($toolname, $tooldep) = ($1, $2); if (!exists(get_tool_names()->{$toolname})) { $line->log_error("Unknown tool \"${toolname}\"."); @@ -6931,9 +6941,10 @@ sub checkfile_PLIST($) { } elsif ($pkgpath ne "graphics/hicolor-icon-theme" && $text =~ m"^share/icons/hicolor(?:$|/)") { my $f = "../../graphics/hicolor-icon-theme/buildlink3.mk"; if (defined($pkgctx_included) && !exists($pkgctx_included->{$f})) { - $line->log_error("Please .include \"$f\""); + $line->log_error("Please .include \"$f\" in the Makefile"); $line->explain_error( -"If hicolor icon themes are installed, icon theme cache must be maintained."); +"If hicolor icon themes are installed, icon theme cache must be", +"maintained. The hicolor-icon-theme package takes care of that."); } } elsif ($pkgpath ne "graphics/gnome-icon-theme" && $text =~ m"^share/icons/gnome(?:$|/)") { @@ -7164,12 +7175,14 @@ sub checkdir_root() { next; } - if (defined($prev_subdir) && $subdir eq $prev_subdir) { + if (!defined($prev_subdir) || $subdir gt $prev_subdir) { + # correctly ordered + } elsif ($subdir eq $prev_subdir) { $line->log_error("${subdir} must only appear once."); - } elsif (defined($prev_subdir) && $subdir lt $prev_subdir) { - $line->log_warning("${subdir} should come before ${prev_subdir}."); + } elsif ($prev_subdir eq "x11" && $subdir eq "archivers") { + # ignore that one, since it is documented in the top-level Makefile } else { - # correctly ordered + $line->log_warning("${subdir} should come before ${prev_subdir}."); } $prev_subdir = $subdir; |