pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Fixed a null pointer exceptio...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6418a1aff72d
branches:  trunk
changeset: 515708:6418a1aff72d
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Jul 06 22:06:15 2006 +0000

description:
- 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/.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 5b3fa2f6cdaf -r 6418a1aff72d pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Jul 06 22:04:03 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Jul 06 22:06:15 2006 +0000
@@ -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 @@
                # 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 @@
        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 @@
                        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 @@
                                        $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.");
 



Home | Main Index | Thread Index | Old Index