pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Updated pkglint to 4.29.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e6ae5f253620
branches:  trunk
changeset: 501502:e6ae5f253620
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 23 19:20:33 2005 +0000

description:
Updated pkglint to 4.29.

Fixed the detection of list variables that are modified with operators
other than "+=". Added *_SKIP to the list of plural variable names.
Removed some unused variables from main(). (This change include
white-space changes.)

diffstat:

 pkgtools/pkglint/Makefile         |    4 +-
 pkgtools/pkglint/files/pkglint.pl |  118 ++++++++++++++++++-------------------
 2 files changed, 59 insertions(+), 63 deletions(-)

diffs (178 lines):

diff -r 147e46ba12c6 -r e6ae5f253620 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Oct 23 19:15:35 2005 +0000
+++ b/pkgtools/pkglint/Makefile Sun Oct 23 19:20:33 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.266 2005/10/21 07:20:24 rillig Exp $
+# $NetBSD: Makefile,v 1.267 2005/10/23 19:20:33 rillig Exp $
 #
 
-DISTNAME=      pkglint-4.28.2
+DISTNAME=      pkglint-4.29
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 147e46ba12c6 -r e6ae5f253620 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Oct 23 19:15:35 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Oct 23 19:20:33 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.300 2005/10/21 07:20:24 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.301 2005/10/23 19:20:33 rillig Exp $
 #
 # This version contains lots of changes necessary for NetBSD packages
 # done by:
@@ -1207,6 +1207,7 @@
                .*_ENV
                .*_REQD
                .*_SED
+               .*_SKIP
                BUILDLINK_LDADD
                BUILDLINK_RECOMMENDED
                COMMENT
@@ -1266,9 +1267,12 @@
        my ($line, $vartypes) = @_;
        if ($line->text =~ $regex_varassign) {
                my ($varname, $op, $value) = ($1, $2, $3);
+               my $varbase = ($varname =~ qr"(.+?)\..*") ? $1 : $varname;
+               my $type = exists($vartypes->{$varname}) ? $vartypes->{$varname}
+                       : exists($vartypes->{$varbase}) ? $vartypes->{$varbase}
+                       : undef;
 
                if ($op eq "+=") {
-                       my $varbase = ($varname =~ qr"(.+?)\..*") ? $1 : $varname;
                        my $regex_plurals = get_regex_plurals();
 
                        if ($varbase !~ $regex_plurals) {
@@ -1276,71 +1280,64 @@
                        }
                }
 
-               if (exists($vartypes->{$varname})) {
-                       my ($type) = ($vartypes->{$varname});
-
-                       if ($type eq "Readonly") {
-                               $line->log_error("\"${varname}\" must not be modified by the package or the user.");
-
-                       } elsif ($value =~ $regex_unresolved) {
-                               # ignore values that contain other variables
-
-                       } elsif ($type eq "Boolean") {
-                               if ($value !~ $regex_yesno) {
-                                       $line->log_warning("$varname should be set to YES, yes, NO, or no.");
-                               }
-
-                       } elsif ($type eq "Yes_Or_Undefined") {
-                               if ($value !~ $regex_yes) {
-                                       $line->log_warning("$varname should be set to YES or yes.");
-                               }
-
-                       } elsif ($type eq "Mail_Address") {
-                               if ($value !~ $regex_mail_address) {
-                                       $line->log_warning("\"$value\" is not a valid mail address.");
-                               }
-
-                       } elsif ($type eq "URL") {
-                               if ($value !~ $regex_url) {
-                                       $line->log_warning("\"$value\" is not a valid URL.");
-                               }
-
-                       } elsif ($type eq "Integer") {
-                               if ($value !~ qr"^\d+$") {
-                                       $line->log_warning("\"$value\" is not a valid Integer.");
-                               }
-
-                       } elsif ($type =~ qr"^List(?: of (.*))?$") {
-                               my ($element_type) = ($1);
-
-                               if ($op ne "+=" && $value !~ qr"^#") {
-                                       $line->log_warning("${varname} should be modified using \"+=\".");
-                               }
-
-                               if (!defined($element_type)) {
-                                       # no further checks possible.
-
-                               } elsif ($element_type eq "Dependency") {
-                                       if ($value =~ $regex_unresolved) {
-                                               # don't even try to check anything
-                                       } elsif ($value =~ qr":\.\./\.\./") {
-                                               # great.
-                                       } elsif ($value =~ qr":\.\./") {
-                                               $line->log_warning("Dependencies should have the form \"../../category/package\".");
-                                       } else {
-                                               $line->log_warning("Unknown dependency format.");
-                                       }
-
+               if (!defined($type)) {
+                       $line->log_info("[checkline_Makefile_vartype] Unchecked variable ${varname}");
+
+               } elsif ($type eq "Readonly") {
+                       $line->log_error("\"${varname}\" must not be modified by the package or the user.");
+
+               } elsif ($type eq "Boolean") {
+                       if ($value !~ $regex_yesno) {
+                               $line->log_warning("$varname should be set to YES, yes, NO, or no.");
+                       }
+
+               } elsif ($type eq "Yes_Or_Undefined") {
+                       if ($value !~ $regex_yes) {
+                               $line->log_warning("$varname should be set to YES or yes.");
+                       }
+
+               } elsif ($type eq "Mail_Address") {
+                       if ($value !~ $regex_mail_address) {
+                               $line->log_warning("\"$value\" is not a valid mail address.");
+                       }
+
+               } elsif ($type eq "URL") {
+                       if ($value !~ $regex_unresolved && $value !~ $regex_url) {
+                               $line->log_warning("\"$value\" is not a valid URL.");
+                       }
+
+               } elsif ($type eq "Integer") {
+                       if ($value !~ qr"^\d+$") {
+                               $line->log_warning("\"$value\" is not a valid Integer.");
+                       }
+
+               } elsif ($type =~ qr"^List(?: of (.*))?$") {
+                       my ($element_type) = ($1);
+
+                       if ($op ne "+=" && $value !~ qr"^#") {
+                               $line->log_warning("${varname} should be modified using \"+=\".");
+                       }
+
+                       if (!defined($element_type)) {
+                               # no further checks possible.
+
+                       } elsif ($element_type eq "Dependency") {
+                               if ($value =~ $regex_unresolved) {
+                                       # don't even try to check anything
+                               } elsif ($value =~ qr":\.\./\.\./") {
+                                       # great.
+                               } elsif ($value =~ qr":\.\./") {
+                                       $line->log_warning("Dependencies should have the form \"../../category/package\".");
                                } else {
-                                       $line->log_error("[internal] Element-type ${element_type} unknown.");
+                                       $line->log_warning("Unknown dependency format.");
                                }
 
                        } else {
-                               $line->log_error("[internal] Type $type unknown.");
+                               $line->log_error("[internal] Element-type ${element_type} unknown.");
                        }
 
                } else {
-                       $line->log_info("[checkline_Makefile_vartype] Unchecked variable ${varname}");
+                       $line->log_error("[internal] Type $type unknown.");
                }
        }
 }
@@ -2665,7 +2662,6 @@
 #
 
 sub main() {
-       my ($startsec, $startusec, $endsec, $endusec);
 
        parse_command_line();
 



Home | Main Index | Thread Index | Old Index