Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 11 Feb 2021 20:31:22
Message-Id: 1613075475.ec1de2ac234dace0422097caa55c1b43c8fee539.mgorny@gentoo
1 commit: ec1de2ac234dace0422097caa55c1b43c8fee539
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 7 10:42:39 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 11 20:31:15 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec1de2ac
7
8 python-r1.eclass: Allow empty depstring to python_gen_any_dep
9
10 Allow python_gen_any_dep to accept an empty/missing depstring, in order
11 to generate a pure dependency on the Python interpreter. This is
12 a valid use case for it since python-r1 does not provide any-r1 style
13 PYTHON_DEPS.
14
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 eclass/python-r1.eclass | 15 ++++++++-------
18 1 file changed, 8 insertions(+), 7 deletions(-)
19
20 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
21 index 5cae020c6d9..74e3fb38a1c 100644
22 --- a/eclass/python-r1.eclass
23 +++ b/eclass/python-r1.eclass
24 @@ -524,16 +524,18 @@ python_gen_impl_dep() {
25 }
26
27 # @FUNCTION: python_gen_any_dep
28 -# @USAGE: <dependency-block> [<impl-pattern>...]
29 +# @USAGE: [<dependency-block> [<impl-pattern>...]]
30 # @DESCRIPTION:
31 # Generate an any-of dependency that enforces a version match between
32 -# the Python interpreter and Python packages. <dependency-block> needs
33 -# to list one or more dependencies with verbatim '${PYTHON_USEDEP}'
34 +# the Python interpreter and Python packages. <dependency-block> may
35 +# list one or more dependencies with verbatim '${PYTHON_USEDEP}'
36 # or '${PYTHON_SINGLE_USEDEP}' references (quoted!) that will get
37 -# expanded inside the function. Optionally, patterns may be specified
38 -# to restrict the dependency to a subset of Python implementations
39 -# supported by the ebuild.
40 +# expanded inside the function. If <dependency-block> is an empty string
41 +# (or no arguments are passed), a pure dependency on any Python
42 +# interpreter will be generated.
43 #
44 +# Optionally, patterns may be specified to restrict the dependency to
45 +# a subset of Python implementations supported by the ebuild.
46 # The patterns can be either fnmatch-style patterns (matched via bash
47 # == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
48 # appropriately all enabled Python 2/3 implementations (alike
49 @@ -587,7 +589,6 @@ python_gen_any_dep() {
50 debug-print-function ${FUNCNAME} "${@}"
51
52 local depstr=${1}
53 - [[ ${depstr} ]] || die "No dependency string provided"
54 shift
55
56 local i PYTHON_PKG_DEP out=