summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2005-10-21 07:20:24 +0000
committerrillig <rillig>2005-10-21 07:20:24 +0000
commitf2e066a520261fef7f8ab36ebb87fba77c68d87f (patch)
tree9c837004ab3f5dd830395d8f8c57004dfa472ce9 /pkgtools
parent41728872fa2616dc618016261963e078cba4367b (diff)
downloadpkgsrc-f2e066a520261fef7f8ab36ebb87fba77c68d87f.tar.gz
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 (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/makevars.map5
-rw-r--r--pkgtools/pkglint/files/pkglint.pl40
3 files changed, 34 insertions, 15 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 4c87df83129..ff5421cd235 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -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 --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map
index 56758b7ecf8..2e90439b004 100644
--- a/pkgtools/pkglint/files/makevars.map
+++ b/pkgtools/pkglint/files/makevars.map
@@ -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 @@ MAKE_ENV List
CONFIGURE_ENV List
MAKE_FLAGS List
CONFIGURE_ARGS List
+
+PKGVERSION Readonly
+PKGBASE Readonly
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index c40f3168cbe..dbc6236867a 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -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 @@ sub get_regex_plurals() {
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 @@ sub get_regex_plurals() {
INTERACTIVE_STAGE
LICENSE
MASTER_SITE_.*
+ MASTER_SORT_REGEX
NOT_FOR_COMPILER
NOT_FOR_PLATFORM
ONLY_FOR_COMPILER
@@ -1259,12 +1266,26 @@ sub checkline_Makefile_vartype($$) {
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 @@ sub checkline_Makefile_vartype($$) {
$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}");
}
}
}