Fixed variable type of PYTHON_VERSIONED_DEPENDENCIES, so that build-time

and run-time dependencies can be specified without pkglint warnings.
This commit is contained in:
rillig 2014-10-08 19:15:16 +00:00
parent fc61963cd8
commit f139df9027
2 changed files with 21 additions and 4 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: makevars.map,v 1.254 2014/08/07 20:35:34 wiz Exp $
# $NetBSD: makevars.map,v 1.255 2014/10/08 19:15:16 rillig Exp $
#
# This file contains the guessed type of some variables, according to
@ -10,9 +10,12 @@
# The type Yes is used for variables that are checked using
# .if defined(VAR)
#
# Type type List is used for lists of things. There are two types of lists,
# The type List is used for lists of things. There are two types of lists,
# InternalList and List, which are described in the pkgsrc guide, chapter
# "Makefiles".
#
# The other types are described in pkglint.pl, checkline_mk_vartype_basic.
#
#
# Some commonly used ACLs. For further documentation, see the chapter
@ -656,7 +659,7 @@ PYTHON_VERSIONS_ACCEPTED List of Version [$package]
PYTHON_VERSIONS_INCOMPATIBLE List of Version [$package]
PYTHON_VERSION_DEFAULT Version [$user]
PYTHON_VERSION_REQD Version [$user]
PYTHON_VERSIONED_DEPENDENCIES List of Identifier [$package_list]
PYTHON_VERSIONED_DEPENDENCIES List of PythonDependency [$package_list]
RANLIB ShellCommand [$system]
RCD_SCRIPTS List of Filename [$package_list]
RCD_SCRIPT_SRC.* List of Pathname [m:s]

View file

@ -1,5 +1,5 @@
#! @PERL@
# $NetBSD: pkglint.pl,v 1.870 2014/09/08 12:05:10 wiz Exp $
# $NetBSD: pkglint.pl,v 1.871 2014/10/08 19:15:16 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@ -4317,6 +4317,20 @@ sub checkline_mk_vartype_basic($$$$$$$$) {
}
},
PythonDependency => sub {
if ($value ne $value_novar) {
$line->log_warning("Python dependencies should not contain variables.");
}
if ($value_novar !~ m"^[+\-.0-9A-Z_a-z]+(?:|:link|:build)$") {
$line->log_warning("Invalid Python dependency \"${value}\".");
$line->explain_warning(
"Python dependencies must be an identifier for a package, as specified",
"in lang/python/versioned_dependencies.mk. This identifier may be",
"followed by :build for a build-time only dependency, or by :link for",
"a run-time only dependency.");
}
},
RelativePkgDir => sub {
checkline_relative_pkgdir($line, $value);
},