diff options
author | rillig <rillig@pkgsrc.org> | 2008-10-09 16:19:23 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2008-10-09 16:19:23 +0000 |
commit | e779a5ed9312ddee60c85766f47923cc87b90ba1 (patch) | |
tree | 683a1a744a94f358ee300e7168bd9656996fca50 /pkgtools | |
parent | 620e4165214f2edf0af40c802a420830982e3db3 (diff) | |
download | pkgsrc-e779a5ed9312ddee60c85766f47923cc87b90ba1.tar.gz |
Updated pkglint to 4.88.
Changes since 4.87:
- Added support for PLIST_VARS and PLIST.*, which had been added in April.
That's a long time ago ...
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 15 |
3 files changed, 19 insertions, 4 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index debc68a4ef7..b6a5035da0b 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.376 2008/08/30 06:54:10 rillig Exp $ +# $NetBSD: Makefile,v 1.377 2008/10/09 16:19:23 rillig Exp $ # # Please don't increase the version number if you are not rillig. -DISTNAME= pkglint-4.87 +DISTNAME= pkglint-4.88 CATEGORIES= pkgtools MASTER_SITES= # none DISTFILES= # none diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 8428f28d96a..8e6087d9109 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.184 2008/08/31 21:03:16 rillig Exp $ +# $NetBSD: makevars.map,v 1.185 2008/10/09 16:19:24 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -593,6 +593,8 @@ PKG_UID Integer [m:s] PKG_USERS List of ShellWord [m:as] PKG_USERS_VARS List of Varname [$package] PKG_USE_KERBEROS Yes [m:s,c:s] +#PLIST.* # has special handling code +PLIST_VARS List of Identifier [$package_list] PLIST_SRC List of RelativePkgPath [$package_list] PLIST_SUBST List of ShellWord [$package_list] PLIST_TYPE { dynamic static } diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 93c36f12402..35b39fa1b1d 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.773 2008/09/16 14:24:25 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.774 2008/10/09 16:19:24 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -1855,6 +1855,7 @@ my $mkctx_varuse; # { varname => line } for all variables my $mkctx_build_defs; # Set of variables that are registered in # BUILD_DEFS, to assure that all user-defined # variables are added to it. +my $mkctx_plist_vars; # The same for PLIST_VARS. my $mkctx_tools; # Set of tools that are declared to be used. my @todo_items; # The list of directory entries that still need @@ -3228,6 +3229,7 @@ sub get_variable_type($$) { : ($varname =~ qr"_ARGS$") ? PkgLint::Type->new(LK_EXTERNAL, "ShellWord", allow_runtime, GUESSED) : ($varname =~ qr"_(?:C|CPP|CXX|LD|)FLAGS$") ? PkgLint::Type->new(LK_EXTERNAL, "ShellWord", allow_runtime, GUESSED) : ($varname =~ qr"_MK$") ? PkgLint::Type->new(LK_NONE, "Unchecked", allow_all, GUESSED) + : ($varname =~ qr"^PLIST.") ? PkgLint::Type->new(LK_NONE, "Yes", allow_all, GUESSED) : undef; if (defined($type)) { @@ -4066,6 +4068,9 @@ sub checkline_mk_varuse($$$$) { } elsif (defined($mkctx_for_variables) && exists($mkctx_for_variables->{$varname})) { # Variables defined in .for loops are also ok. + } elsif (defined($mkctx_plist_vars) && exists($mkctx_plist_vars->{$varname})) { + # PLIST variables are also ok. + } else { $opt_warn_extra and $line->log_warning("${varname} is used but not defined. Spelling mistake?"); } @@ -6220,6 +6225,7 @@ sub checklines_mk($) { $mkctx_for_variables = {}; $mkctx_vardef = {}; $mkctx_build_defs = {}; + $mkctx_plist_vars = {}; $mkctx_tools = {%{get_predefined_tool_names()}}; $mkctx_varuse = {}; @@ -6246,6 +6252,12 @@ sub checklines_mk($) { $opt_debug_misc and $line->log_debug("${varname} is added to BUILD_DEFS."); } + } elsif ($varcanon eq "PLIST_VARS") { + foreach my $id (split(qr"\s+", $line->get("value"))) { + $mkctx_plist_vars->{"PLIST.$id"} = true; + $opt_debug_misc and $line->log_debug("PLIST.${id} is added to PLIST_VARS."); + } + } elsif ($varcanon eq "USE_TOOLS") { foreach my $tool (split(qr"\s+", $line->get("value"))) { $mkctx_tools->{$tool} = true; @@ -6510,6 +6522,7 @@ sub checklines_mk($) { $mkctx_target = undef; $mkctx_vardef = undef; $mkctx_build_defs = undef; + $mkctx_plist_vars = undef; $mkctx_tools = undef; $mkctx_varuse = undef; } |