pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Normalized capitalization of lo...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4fd7abcc8e72
branches:  trunk
changeset: 494309:4fd7abcc8e72
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun May 22 23:53:56 2005 +0000

description:
Normalized capitalization of log messages.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  352 ++++++++++++++++++-------------------
 1 files changed, 171 insertions(+), 181 deletions(-)

diffs (truncated from 1130 to 300 lines):

diff -r b50f35ca19ff -r 4fd7abcc8e72 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun May 22 22:59:41 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun May 22 23:53:56 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.167 2005/05/22 22:59:41 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.168 2005/05/22 23:53:56 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -82,8 +82,8 @@
 # print_summary_and_exit should be called.
 #
 # Examples:
-#   log_error(NO_FILE, NO_LINE_NUMBER, "invalid command line.");
-#   log_warning($file, NO_LINE_NUMBER, "not found.");
+#   log_error(NO_FILE, NO_LINE_NUMBER, "Invalid command line.");
+#   log_warning($file, NO_LINE_NUMBER, "Not found.");
 #   log_info($file, $lineno, sprintf("invalid character (0x%02x).", $c));
 #==========================================================================
 
@@ -506,7 +506,7 @@
                } elsif ($line->text =~ qr"^([\w\d_.]+)\s+([\w_]+)$") {
                        $make_vars_typemap{$1} = $2;
                } else {
-                       $line->log_error("[internal] unknown line format");
+                       $line->log_error("[internal] Unknown line format.");
                }
        }
        return true;
@@ -519,10 +519,10 @@
        my ($ignoring) = false;
 
        if (!$lines) {
-               log_error($fname, NO_LINE_NUMBER, "could not load file");
+               log_error($fname, NO_LINE_NUMBER, "Could not be read.");
                return false;
        }
-       log_info($fname, NO_LINE_NUMBER, "Loading MASTER_SITE_* definitions");
+       log_info($fname, NO_LINE_NUMBER, "Loading MASTER_SITE_* definitions.");
        foreach my $line (@{$lines}) {
                if ($line->text =~ qr"^(MASTER_SITE_\w+)\+=\s*\\$"o) {
                        $varname = $1;
@@ -534,7 +534,7 @@
                                if (defined($varname)) {
                                        $predefined_sites{$1} = $varname;
                                } else {
-                                       $line->log_warning("Lonely URL found");
+                                       $line->log_error("Lonely URL found.");
                                }
                        }
                } elsif ($line->text =~ qr"^(?:#.*|\s*)$") {
@@ -542,10 +542,10 @@
                } elsif ($line->text =~ qr"BSD_SITES_MK") {
                        # ignore multiple inclusion guards
                } else {
-                       $line->log_warning("Unknown line type: " . $line->text);
+                       $line->log_error("Unknown line type.");
                }
        }
-       log_info($fname, NO_LINE_NUMBER, sprintf("Loaded %d MASTER_SITE_* definitions", scalar(keys(%predefined_sites))));
+       log_info($fname, NO_LINE_NUMBER, sprintf("Loaded %d MASTER_SITE_* definitions.", scalar(keys(%predefined_sites))));
        return true;
 }
 
@@ -555,7 +555,7 @@
        init_global_vars();
        if (-f "$opt_packagedir/../mk/bsd.pkg.mk") {
                $pkgsrc_rootdir = "$opt_packagedir/..";
-               log_info(NO_FILE, NO_LINE_NUMBER, "checking category Makefile.");
+               log_info(NO_FILE, NO_LINE_NUMBER, "Checking category Makefile.");
                category_check();
        } elsif (-f "$opt_packagedir/../../mk/bsd.pkg.mk") {
                $pkgsrc_rootdir = "$opt_packagedir/../..";
@@ -565,7 +565,7 @@
                load_predefined_sites();
                check_package();
        } else {
-               log_error(NO_FILE, NO_LINE_NUMBER, "cannot check \"$opt_packagedir\".");
+               log_error($opt_packagedir, NO_LINE_NUMBER, "Neither a package nor a category.");
        }
 }
 
@@ -587,11 +587,11 @@
 
 sub check_package() {
        # we need to handle the Makefile first to get some variables
-       log_info(NO_FILE, NO_LINE_NUMBER, "checking Makefile.");
-       if (! -f "$opt_packagedir/Makefile") {
-               log_error("$opt_packagedir/Makefile", NO_LINE_NUMBER, "file not found.");
-       } else {
-               checkfile_Makefile("Makefile") || log_error("$opt_packagedir/Makefile", NO_LINE_NUMBER, "error while reading.");
+       log_info(NO_FILE, NO_LINE_NUMBER, "Checking Makefile.");
+
+       if (checkfile_Makefile("Makefile")) {
+               log_error("$opt_packagedir/Makefile", NO_LINE_NUMBER, "Cannot be read.");
+               return false;
        }
 
        checkfile_DESCR("$pkgdir/DESCR");
@@ -634,7 +634,7 @@
                        }
                }
                if ($patches && ! -f "$opt_packagedir/$distinfo" ) {
-                       log_warning("$opt_packagedir/$distinfo", NO_LINE_NUMBER, "file not found. Please run '$conf_make makepatchsum'.");
+                       log_warning("$opt_packagedir/$distinfo", NO_LINE_NUMBER, "File not found. Please run '$conf_make makepatchsum'.");
                }
        }
        if ($opt_check_extra) {
@@ -649,44 +649,44 @@
 
        if (-f "$opt_packagedir/$distinfo") {
                if ( $seen_NO_CHECKSUM ) {
-                       log_warning("$opt_packagedir/$distinfo", NO_LINE_NUMBER, "this file should not exist if NO_CHECKSUM is set");
+                       log_warning("$opt_packagedir/$distinfo", NO_LINE_NUMBER, "This file should not exist if NO_CHECKSUM is set.");
                }
        } else {
                if ( ! $seen_NO_CHECKSUM ) {
-                       log_warning("$opt_packagedir/$distinfo", NO_LINE_NUMBER, "file not found. Please run '$conf_make makesum'.");
+                       log_warning("$opt_packagedir/$distinfo", NO_LINE_NUMBER, "File not found. Please run '$conf_make makesum'.");
                }
        }
        if (-f "$opt_packagedir/$filesdir/md5") {
-               log_error("$opt_packagedir/$filesdir/md5", NO_LINE_NUMBER, "this file is deprecated -- run '$conf_make mdi' to generate distinfo.");
+               log_error("$opt_packagedir/$filesdir/md5", NO_LINE_NUMBER, "This file is deprecated -- run '$conf_make mdi' to generate distinfo.");
        }
        if (-f "$opt_packagedir/$filesdir/patch-sum") {
-               log_error("$opt_packagedir/$filesdir/patch-sum", NO_LINE_NUMBER, "this file is deprecated -- run '$conf_make mps' to generate distinfo.");
+               log_error("$opt_packagedir/$filesdir/patch-sum", NO_LINE_NUMBER, "This file is deprecated -- run '$conf_make mps' to generate distinfo.");
        }
        if (-f "$opt_packagedir/$pkgdir/COMMENT") {
-               log_error("$opt_packagedir/$pkgdir/COMMENT", NO_LINE_NUMBER, "this file is deprecated -- please use a COMMENT variable instead.");
+               log_error("$opt_packagedir/$pkgdir/COMMENT", NO_LINE_NUMBER, "This file is deprecated -- please use a COMMENT variable instead.");
        }
        if (-d "$opt_packagedir/pkg") {
-               log_error("$opt_packagedir/pkg", NO_LINE_NUMBER, "this directory and its contents are deprecated! Please 'mv $opt_packagedir/pkg/* $opt_packagedir' and 'rmdir $opt_packagedir/pkg'.");
+               log_error("$opt_packagedir/pkg", NO_LINE_NUMBER, "This directory and its contents are deprecated! Please 'mv $opt_packagedir/pkg/* $opt_packagedir' and 'rmdir $opt_packagedir/pkg'.");
        }
        if (-d "$opt_packagedir/scripts") {
-               log_warning("$opt_packagedir/scripts", NO_LINE_NUMBER, "this directory and its contents are deprecated! Please call the script(s) explicitly from the corresponding target(s) in the 
pkg's Makefile.");
+               log_warning("$opt_packagedir/scripts", NO_LINE_NUMBER, "This directory and its contents are deprecated! Please call the script(s) explicitly from the corresponding target(s) in the 
pkg's Makefile.");
        }
        if (! -f "$opt_packagedir/$pkgdir/PLIST"
            and ! -f "$opt_packagedir/$pkgdir/PLIST.common"
            and ! $seen_PLIST_SRC
            and ! $seen_NO_PKG_REGISTER ) {
-               log_warning(NO_FILE, NO_LINE_NUMBER, "no PLIST or PLIST.common, and PLIST_SRC and NO_PKG_REGISTER unset. Are you sure PLIST handling is ok?");
+               log_warning(NO_FILE, NO_LINE_NUMBER, "No PLIST or PLIST.common, and PLIST_SRC and NO_PKG_REGISTER unset. Are you sure PLIST handling is ok?");
        }
        foreach my $wrkdir (<$opt_packagedir/work*>) {
                if ($opt_warn_workdir && -d $wrkdir) {
-                       log_warning($wrkdir, NO_LINE_NUMBER, "should be cleaned up before committing the package.");
+                       log_warning($wrkdir, NO_LINE_NUMBER, "Should be cleaned up before committing the package.");
                }
        }
        foreach my $backup (<$opt_packagedir/*~>, <$opt_packagedir/*/*~>) {
-               log_warning($backup, NO_LINE_NUMBER, "should be cleaned up before committing the package.");
+               log_warning($backup, NO_LINE_NUMBER, "Should be cleaned up before committing the package.");
        }
        foreach my $orig (<$opt_packagedir/*/*.orig>, <$opt_packagedir/*.orig>, <$opt_packagedir/*/*.rej>, <$opt_packagedir/*.rej>) {
-               log_warning($orig, NO_LINE_NUMBER, "should be cleaned up before committing the package.");
+               log_warning($orig, NO_LINE_NUMBER, "Should be cleaned up before committing the package.");
        }
        return true;
 } # check_package
@@ -711,8 +711,7 @@
        ($rest = $line->text) =~ s/$re_validchars//g;
        if ($rest ne "") {
                my @chars = map { $_ = sprintf("0x%02x", ord($_)); } split(//, $rest);
-               $line->log_warning(
-                       sprintf("Line contains invalid characters (%s).", join(", ", @chars)));
+               $line->log_warning(sprintf("Line contains invalid characters (%s).", join(", ", @chars)));
        }
        return true;
 }
@@ -750,7 +749,7 @@
 
        checkperms($fname);
        if (!defined($descr = load_file($fname))) {
-               log_error($fname, NO_LINE_NUMBER, "Error while reading.");
+               log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
                return false;
        }
 
@@ -775,7 +774,7 @@
 
        checkperms($fname);
        if (!defined($distinfo = load_file($fname))) {
-               log_error($fname, NO_LINE_NUMBER, "Error while reading.");
+               log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
                return false;
        }
 
@@ -793,7 +792,7 @@
                my ($alg, $patch, $sum) = ($1, $2, $3);
 
                if ($patch =~ /~$/) {
-                       $line->log_warning("possible backup file \"$patch\"?");
+                       $line->log_warning("Possible backup file \"$patch\"?");
                }
 
                if ($patch =~ /^patch-[-A-Za-z0-9_.]+$/) {
@@ -801,7 +800,7 @@
                                my $chksum = `sed -e '/\$NetBSD.*/d' $opt_packagedir/$patchdir/$patch | digest $alg`;
                                $chksum =~ s/\r*\n*\z//;
                                if ($sum ne $chksum) {
-                                       $line->log_error("checksum of $patch differs. Rerun '$conf_make makepatchsum'.");
+                                       $line->log_error("Checksum of $patch differs. Rerun '$conf_make makepatchsum'.");
                                }
                        } else {
                                $line->log_error("$patch does not exist.");
@@ -827,19 +826,19 @@
 
        checkperms($fname);
        if (!defined($message = load_file($fname))) {
-               log_error($fname, NO_LINE_NUMBER, "error while reading.");
+               log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
                return false;
        }
 
        if (scalar(@$message) < 3) {
-               log_warning($fname, NO_LINE_NUMBER, "file too short.");
+               log_warning($fname, NO_LINE_NUMBER, "File too short.");
                return true;
        }
        if ($message->[0]->text ne "=" x 75) {
-               $message->[0]->log_warning("expected a line of exactly 75 \"=\" characters.");
+               $message->[0]->log_warning("Expected a line of exactly 75 \"=\" characters.");
        }
        if ($message->[1]->text !~ /^$regex_rcsidstr$/) {
-               $message->[1]->log_error("expected the RCS Id tag.");
+               $message->[1]->log_error("Expected the RCS Id tag.");
        }
        foreach my $line (@$message[2 .. scalar(@$message) - 2]) {
                checkline_length($line, 80);
@@ -847,7 +846,7 @@
                checkline_valid_characters($line, $regex_validchars);
        }
        if ($message->[-1]->text ne "=" x 75) {
-               $message->[-1]->log_warning("expected a line of exactly 75 \"=\" characters.");
+               $message->[-1]->log_warning("Expected a line of exactly 75 \"=\" characters.");
        }
        checklines_trailing_empty_lines($message);
        return true;
@@ -860,7 +859,7 @@
        
        checkperms($fname);
        if (!defined($plist = load_file($fname))) {
-               log_error($fname, NO_LINE_NUMBER, "error while reading.");
+               log_error($fname, NO_LINE_NUMBER, "Cannot be read.");
                return false;
        }
 
@@ -877,7 +876,7 @@
                        if ($cmd eq "cwd" || $cmd eq "cd") {
                                $curdir = $arg;
                        } elsif ($cmd eq "unexec" && $arg =~ /^rmdir/) {
-                               $line->log_warning("use \"\@dirrm\" instead of \"\@unexec rmdir\".");
+                               $line->log_warning("Use \"\@dirrm\" instead of \"\@unexec rmdir\".");
                        } elsif (($cmd eq "exec" || $cmd eq "unexec")) {
                                if ($arg =~ /(?:install-info|\$\{INSTALL_INFO\})/) {
                                        $line->log_warning("\@exec/unexec install-info is deprecated.");
@@ -894,38 +893,38 @@
                                $line->log_warning("\"\@mode/owner/group\" are deprecated, please use chmod/".
                                        "chown/chgrp in the pkg Makefile and let tar do the rest.");
                        } else {
-                               $line->log_warning("unknown PLIST directive \"\@$cmd\"");
+                               $line->log_warning("Unknown PLIST directive \"\@$cmd\"");
                        }
                        next line;
                }
 
                if ($line->text =~ /^\//) {
-                       $line->log_error("use of full pathname disallowed.");
+                       $line->log_error("Use of full pathname disallowed.");
                }
 
                if ($opt_warn_sort && $line->text =~ qr"^\w") {
                        if (defined($last_file_seen)) {
                                if ($last_file_seen gt $line->text) {
-                                       $line->log_warning( $line->text." should be sorted before ${last_file_seen}.");
+                                       $line->log_warning($line->text . " should be sorted before ${last_file_seen}.");
                                }
                        }
                        $last_file_seen = $line->text;
                }
 
                if ($line->text =~ /^doc/) {
-                       $line->log_error("documentation must be installed under share/doc, not doc.");
+                       $line->log_error("Documentation must be installed under share/doc, not doc.");
                }
 
                if ($line->text =~ /^etc/ && $line->text !~ /^etc\/rc.d/) {
-                       $line->log_error("configuration files must not be ".
-                               "registered in the PLIST (don't you use the ".
-                               "PKG_SYSCONFDIR framework?)");
+                       $line->log_error("Configuration files must not be ".
+                               "registered in the PLIST. Please use the ".



Home | Main Index | Thread Index | Old Index