pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc Updated pkglint to 4.28.2.
details: https://anonhg.NetBSD.org/pkgsrc/rev/51bb5ce2b55b
branches: trunk
changeset: 501367:51bb5ce2b55b
user: rillig <rillig%pkgsrc.org@localhost>
date: Fri Oct 21 07:20:24 2005 +0000
description:
Updated pkglint to 4.28.2.
Added a data type Readonly for variables that must not be given any
value at all by the package Makefile. Marked PKGBASE and PKGVERSION
read-only, because leaving them read-write would make the way PKGNAME is
calculated too complex. Made the check for the "+=" operator independent
of the data type. Added more patterns for accepted variable names for
lists.
diffstat:
doc/CHANGES | 3 +-
pkgtools/pkglint/Makefile | 4 +-
pkgtools/pkglint/files/makevars.map | 5 +++-
pkgtools/pkglint/files/pkglint.pl | 42 +++++++++++++++++++++++++-----------
4 files changed, 37 insertions(+), 17 deletions(-)
diffs (130 lines):
diff -r 29b2317c8160 -r 51bb5ce2b55b doc/CHANGES
--- a/doc/CHANGES Fri Oct 21 04:02:38 2005 +0000
+++ b/doc/CHANGES Fri Oct 21 07:20:24 2005 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.11598 2005/10/21 04:02:38 minskim Exp $
+$NetBSD: CHANGES,v 1.11599 2005/10/21 07:20:55 rillig Exp $
Changes to the packages collection and infrastructure in 2005:
@@ -4760,3 +4760,4 @@
Updated mail/maildrop to 2.0.1 [jlam 2005-10-20]
Added emulators/z26 version 2.13 [minskim 2005-10-21]
Added sysutils/zidrav version 1.20 [minskim 2005-10-21]
+ Updated pkgtools/pkglint to 4.28.2 [rillig 2005-10-21]
diff -r 29b2317c8160 -r 51bb5ce2b55b pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Fri Oct 21 04:02:38 2005 +0000
+++ b/pkgtools/pkglint/Makefile Fri Oct 21 07:20:24 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.265 2005/10/14 09:23:46 rillig Exp $
+# $NetBSD: Makefile,v 1.266 2005/10/21 07:20:24 rillig Exp $
#
-DISTNAME= pkglint-4.28.1
+DISTNAME= pkglint-4.28.2
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff -r 29b2317c8160 -r 51bb5ce2b55b pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map Fri Oct 21 04:02:38 2005 +0000
+++ b/pkgtools/pkglint/files/makevars.map Fri Oct 21 07:20:24 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.16 2005/10/14 09:23:46 rillig Exp $
+# $NetBSD: makevars.map,v 1.17 2005/10/21 07:20:24 rillig Exp $
#
# This file tries to guess the type of some variables, according to their
@@ -68,3 +68,6 @@
CONFIGURE_ENV List
MAKE_FLAGS List
CONFIGURE_ARGS List
+
+PKGVERSION Readonly
+PKGBASE Readonly
diff -r 29b2317c8160 -r 51bb5ce2b55b pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Fri Oct 21 04:02:38 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Fri Oct 21 07:20:24 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.299 2005/10/14 09:23:46 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.300 2005/10/21 07:20:24 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -1203,12 +1203,18 @@
my @plurals_ok = qw(
.*S
+ .*LIST
.*_ENV
.*_REQD
+ .*_SED
BUILDLINK_LDADD
BUILDLINK_RECOMMENDED
COMMENT
EXTRACT_ONLY
+ GENERATE_PLIST
+ PLIST_CAT
+ PLIST_PRE
+ PREPEND_PATH
SUBST_SED
_.*
);
@@ -1226,6 +1232,7 @@
INTERACTIVE_STAGE
LICENSE
MASTER_SITE_.*
+ MASTER_SORT_REGEX
NOT_FOR_COMPILER
NOT_FOR_PLATFORM
ONLY_FOR_COMPILER
@@ -1259,12 +1266,26 @@
my ($line, $vartypes) = @_;
if ($line->text =~ $regex_varassign) {
my ($varname, $op, $value) = ($1, $2, $3);
- if ($value =~ qr"\$") {
- # ignore values that contain other variables
-
- } elsif (exists($vartypes->{$varname})) {
+
+ if ($op eq "+=") {
+ my $varbase = ($varname =~ qr"(.+?)\..*") ? $1 : $varname;
+ my $regex_plurals = get_regex_plurals();
+
+ if ($varbase !~ $regex_plurals) {
+ $line->log_warning("As ${varname} is modified using \"+=\", its name should indicate plural.");
+ }
+ }
+
+ if (exists($vartypes->{$varname})) {
my ($type) = ($vartypes->{$varname});
- if ($type eq "Boolean") {
+
+ 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.");
}
@@ -1318,13 +1339,8 @@
$line->log_error("[internal] Type $type unknown.");
}
- } elsif ($op eq "+=") {
- my $varbase = ($varname =~ qr"(.+?)\..*") ? $1 : $varname;
- my $regex_plurals = get_regex_plurals();
-
- if ($varbase !~ $regex_plurals) {
- $line->log_warning("As ${varname} is modified using \"+=\", its name should indicate plural.");
- }
+ } else {
+ $line->log_info("[checkline_Makefile_vartype] Unchecked variable ${varname}");
}
}
}
Home |
Main Index |
Thread Index |
Old Index