pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Moved the checks for the COMMEN...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f698d249c016
branches:  trunk
changeset: 502891:f698d249c016
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Nov 10 12:04:11 2005 +0000

description:
Moved the checks for the COMMENT from checklines_package_Makefile() to
checktext_basic_vartype() to shorten the former subroutine.
No user-visible changes.

diffstat:

 pkgtools/pkglint/files/makevars.map |   3 ++-
 pkgtools/pkglint/files/pkglint.pl   |  35 +++++++++++++++++------------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diffs (86 lines):

diff -r bb191e35a455 -r f698d249c016 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map       Thu Nov 10 11:49:11 2005 +0000
+++ b/pkgtools/pkglint/files/makevars.map       Thu Nov 10 12:04:11 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.29 2005/11/07 00:45:01 rillig Exp $
+# $NetBSD: makevars.map,v 1.30 2005/11/10 12:04:11 rillig Exp $
 #
 
 # This file contains the guessed type of some variables, according to
@@ -60,6 +60,7 @@
 CATEGORIES             List* of Category
 CC_VERSION             Readonly
 CFLAGS                 List
+COMMENT                        Comment
 CONFIGURE_ARGS         List
 CONFIGURE_DIRS         List* of WrksrcSubdirectory
 CONFIGURE_ENV          List
diff -r bb191e35a455 -r f698d249c016 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Thu Nov 10 11:49:11 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Thu Nov 10 12:04:11 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.345 2005/11/10 11:14:03 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.346 2005/11/10 12:04:11 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -1522,6 +1522,20 @@
                        $line->log_error("Invalid category \"${value}\".");
                }
 
+       } elsif ($type eq "Comment") {
+               if ($value =~ qr"^(a|an)\s+"i) {
+                       $line->log_warning("COMMENT should not begin with '$1'.");
+               }
+               if ($value =~ qr"^[a-z]") {
+                       $line->log_warning("COMMENT should start with a capital letter.");
+               }
+               if ($value =~ qr"\.$") {
+                       $line->log_warning("COMMENT should not end with a period.");
+               }
+               if (length($value) > 70) {
+                       $line->log_warning("COMMENT should not be longer than 70 characters.");
+               }
+
        } elsif ($type eq "Dependency") {
                if ($value =~ regex_unresolved) {
                        # don't even try to check anything
@@ -2008,11 +2022,11 @@
        my ($lineno, $sectindex, $varindex) = (0, -1, 0);
        my ($next_section, $vars, $below, $below_what) = (true, undef, {}, undef);
 
-       # In each interation, one of the following becomes true:
+       # In each iteration, one of the following becomes true:
        # - new.lineno > old.lineno
        # - new.sectindex > old.sectindex
        # - new.sectindex == old.sectindex && new.varindex > old.varindex
-       # - next_section == true
+       # - new.next_section == true && old.next_section == false
        while ($lineno <= $#{$lines}) {
                my $line = $lines->[$lineno];
                my $text = $line->text;
@@ -2112,21 +2126,6 @@
                                #$line->log_error("Variable names starting with an underscore are reserved for internal pkgsrc use.");
                        }
 
-                       if ($varname eq "COMMENT") {
-                               if ($value =~ qr"^(a|an)\s+"i) {
-                                       $line->log_warning("COMMENT should not begin with '$1'.");
-                               }
-                               if ($value =~ qr"^[a-z]") {
-                                       $line->log_warning("COMMENT should start with a capital letter.");
-                               }
-                               if ($value =~ qr"\.$") {
-                                       $line->log_warning("COMMENT should not end with a period.");
-                               }
-                               if (length($value) > 70) {
-                                       $line->log_warning("COMMENT should not be longer than 70 characters.");
-                               }
-                       }
-
                        if ($varname eq "PERL5_PACKLIST" && defined($pkgname) && $pkgname =~ qr"^p5-(.*)-[0-9].*") {
                                my ($guess) = ($1);
                                $guess =~ s/-/\//g;



Home | Main Index | Thread Index | Old Index