summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-07-06 22:06:15 +0000
committerrillig <rillig@pkgsrc.org>2006-07-06 22:06:15 +0000
commit9bb51b2c0eebd8e62d7b7ff400dd707052593f67 (patch)
tree45fff0f50f390daa7e371588f3ab59df5de058be
parentacb94c0b93218d390a343746b2b3cf842233d8a4 (diff)
downloadpkgsrc-9bb51b2c0eebd8e62d7b7ff400dd707052593f67.tar.gz
- Fixed a null pointer exception in check_varassign.
- Added a new check for -Wextra that requires a manual page for every command in bin/ and sbin/.
-rw-r--r--pkgtools/pkglint/files/pkglint.pl25
1 files changed, 20 insertions, 5 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 3b27ead4805..f2d9cfa3790 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.637 2006/07/06 17:40:17 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.638 2006/07/06 22:06:15 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -1422,7 +1422,7 @@ sub check_varassign($$$$$) {
# XXX: This code sometimes produces weird warnings. See
# meta-pkgs/xorg/Makefile.common 1.41 for an example.
if ($self->is_complete()) {
- $self->check_end();
+ $self->check_end($line);
# The following assignment prevents an additional warning,
# but from a technically viewpoint, it is incorrect.
@@ -6502,7 +6502,7 @@ sub checkfile_PLIST($) {
foreach my $line (@{$lines}) {
my $text = $line->text;
- if ($text =~ qr"^\w" && $text !~ regex_unresolved) {
+ if ($text =~ qr"^[\w\$]") {
$all_files->{$text} = $line;
}
}
@@ -6549,8 +6549,16 @@ sub checkfile_PLIST($) {
if ($text =~ qr"^bin/.*/") {
$line->log_warning("The bin/ directory should not have subdirectories.");
- } elsif ($text =~ qr"^bin/") {
- # Fine.
+ } elsif ($text =~ qr"^bin/(.*)") {
+ my ($binname) = ($1);
+
+ if (exists($all_files->{"man/man1/${binname}.1"})) {
+ # Fine.
+ } elsif (exists($all_files->{"\${IMAKE_MAN_DIR}/${binname}.\${IMAKE_MANNEWSUFFIX}"})) {
+ # Fine.
+ } else {
+ $opt_warn_extra and $line->log_warning("Manual page missing for bin/${binname}.");
+ }
} elsif ($text =~ qr"^doc/") {
$line->log_error("Documentation must be installed under share/doc, not doc.");
@@ -6596,6 +6604,13 @@ sub checkfile_PLIST($) {
$line->log_warning("Preformatted manual page without unformatted one.");
}
+ } elsif ($text =~ qr"^sbin/(.*)") {
+ my ($binname) = ($1);
+
+ if (!exists($all_files->{"man/man8/${binname}.8"})) {
+ $opt_warn_extra and $line->log_warning("Manual page missing for sbin/${binname}.");
+ }
+
} elsif ($text =~ qr"^share/doc/html/") {
$opt_warn_plist_depr and $line->log_warning("Use of \"share/doc/html\" is deprecated. Use \"share/doc/\${PKGBASE}\" instead.");