summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2012-07-14 20:32:37 +0000
committerwiz <wiz@pkgsrc.org>2012-07-14 20:32:37 +0000
commitb55a12b5bb3aed6bcdc1df7c05c690c5ed2e61f0 (patch)
tree0adbdd7f47d57d69864097d3bfd8a5451236bf85 /pkgtools/pkglint
parent0f4e9c3568d49cd21fa2253c58ff7943951a543e (diff)
downloadpkgsrc-b55a12b5bb3aed6bcdc1df7c05c690c5ed2e61f0.tar.gz
Update to 4.117:
Recognize another possible permission. Reported by Bug Hunting.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.18
-rw-r--r--pkgtools/pkglint/files/pkglint.pl15
3 files changed, 19 insertions, 8 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 67f501b7abf..6f25cf1bee6 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.408 2012/07/10 10:53:27 wiz Exp $
+# $NetBSD: Makefile,v 1.409 2012/07/14 20:32:37 wiz Exp $
#
# Note: if you update the version number, please have a look at the
# changes between the CVS tag "pkglint_current" and HEAD.
# After updating, please re-set the CVS tag to HEAD.
-DISTNAME= pkglint-4.116
+DISTNAME= pkglint-4.117
CATEGORIES= pkgtools
MASTER_SITES= # none
DISTFILES= # none
diff --git a/pkgtools/pkglint/files/pkglint.1 b/pkgtools/pkglint/files/pkglint.1
index 54a12c8fbdf..d38799dd1a1 100644
--- a/pkgtools/pkglint/files/pkglint.1
+++ b/pkgtools/pkglint/files/pkglint.1
@@ -1,13 +1,13 @@
-.\" $NetBSD: pkglint.1,v 1.45 2012/07/09 22:11:00 wiz Exp $
+.\" $NetBSD: pkglint.1,v 1.46 2012/07/14 20:32:37 wiz Exp $
.\" From FreeBSD: portlint.1,v 1.8 1997/11/25 14:53:14 itojun Exp
.\"
.\" Copyright (c) 1997 by Jun-ichiro Itoh <itojun@itojun.org>.
.\" All Rights Reserved. Absolutely no warranty.
.\"
.\" Roland Illig <roland.illig@gmx.de>, 2004, 2005.
-w.\" Thomas Klausner <rillig@NetBSD.org>, 2012.
+.\" Thomas Klausner <wiz@NetBSD.org>, 2012.
.\"
-.Dd July 9, 2012
+.Dd July 14, 2012
.Dt PKGLINT 1
.Sh NAME
.Nm pkglint
@@ -171,6 +171,8 @@ use a variable during preprocessing
use a variable at runtime
.It set
set a variable using :=, =, !=
+.It unknown
+permissions for this variable currently not known
.El
A
.Sq \&?
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 01f3832f8c3..9777d6378b9 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.840 2012/07/10 10:53:05 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.841 2012/07/14 20:32:37 wiz Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -4742,6 +4742,16 @@ sub checkline_mk_shellcmd($$) {
checkline_mk_shelltext($line, $shellcmd);
}
+sub expand_permission($) {
+ my ($perm) = @_;
+ my %fullperm = ( "a" => "append", "d" => "default", "p" => "preprocess", "s" => "set", "t" => "runtime", "?" => "unknown" );
+ return $fullperm{$perm};
+# for my $element (split(/,/, $perm)) {
+# my ($location, $permission) = split(/:/, $element);
+# return "-- $location == $permission -- ";
+# }
+}
+
sub checkline_mk_vardef($$$) {
my ($line, $varname, $op) = @_;
@@ -4762,9 +4772,8 @@ sub checkline_mk_vardef($$$) {
my $perms = get_variable_perms($line, $varname);
my $needed = { "=" => "s", "!=" => "s", "?=" => "d", "+=" => "a", ":=" => "s" }->{$op};
- my %full = ( "a" => "append", "d" => "default", "p" => "preprocess", "s" => "set", "t" => "runtime" );
if (index($perms, $needed) == -1) {
- $line->log_warning("Permission [$full{$needed}] requested for ${varname}, but only [$full{$perms}] is allowed.");
+ $line->log_warning("Permission [" . expand_permission($needed) . "] requested for ${varname}, but only [" . expand_permission($perms) . "] is allowed.");
$line->explain_warning(
"The available permissions are:",
"\tappend\t\tappend something using +=",