summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-02-07 11:42:39 +0100
committerMichał Górny <mgorny@gentoo.org>2021-02-11 21:31:15 +0100
commitec1de2ac234dace0422097caa55c1b43c8fee539 (patch)
treea5baa81495802fa2465984040600a65498a7d103 /eclass
parentdistutils-r1.eclass: Require EPYTHON to be set (diff)
downloadgentoo-ec1de2ac234dace0422097caa55c1b43c8fee539.tar.gz
gentoo-ec1de2ac234dace0422097caa55c1b43c8fee539.tar.bz2
gentoo-ec1de2ac234dace0422097caa55c1b43c8fee539.zip
python-r1.eclass: Allow empty depstring to python_gen_any_dep
Allow python_gen_any_dep to accept an empty/missing depstring, in order to generate a pure dependency on the Python interpreter. This is a valid use case for it since python-r1 does not provide any-r1 style PYTHON_DEPS. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/python-r1.eclass15
1 files changed, 8 insertions, 7 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 5cae020c6d90..74e3fb38a1cc 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -524,16 +524,18 @@ python_gen_impl_dep() {
}
# @FUNCTION: python_gen_any_dep
-# @USAGE: <dependency-block> [<impl-pattern>...]
+# @USAGE: [<dependency-block> [<impl-pattern>...]]
# @DESCRIPTION:
# Generate an any-of dependency that enforces a version match between
-# the Python interpreter and Python packages. <dependency-block> needs
-# to list one or more dependencies with verbatim '${PYTHON_USEDEP}'
+# the Python interpreter and Python packages. <dependency-block> may
+# list one or more dependencies with verbatim '${PYTHON_USEDEP}'
# or '${PYTHON_SINGLE_USEDEP}' references (quoted!) that will get
-# expanded inside the function. Optionally, patterns may be specified
-# to restrict the dependency to a subset of Python implementations
-# supported by the ebuild.
+# expanded inside the function. If <dependency-block> is an empty string
+# (or no arguments are passed), a pure dependency on any Python
+# interpreter will be generated.
#
+# Optionally, patterns may be specified to restrict the dependency to
+# a subset of Python implementations supported by the ebuild.
# The patterns can be either fnmatch-style patterns (matched via bash
# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
# appropriately all enabled Python 2/3 implementations (alike
@@ -587,7 +589,6 @@ python_gen_any_dep() {
debug-print-function ${FUNCNAME} "${@}"
local depstr=${1}
- [[ ${depstr} ]] || die "No dependency string provided"
shift
local i PYTHON_PKG_DEP out=