summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-11-30 10:56:38 +0100
committerMichał Górny <mgorny@gentoo.org>2019-12-07 15:36:28 +0100
commit1d5b43ab215e7062d48a581b18f69df4eccb40ac (patch)
tree86fe5094f859c9e7ac9ec67cb0430e8b25946d6b /eclass/python-r1.eclass
parentpython-single-r1.eclass: Restore PYTHON_SINGLE_TARGET for one impl (diff)
downloadgentoo-1d5b43ab215e7062d48a581b18f69df4eccb40ac.tar.gz
gentoo-1d5b43ab215e7062d48a581b18f69df4eccb40ac.tar.bz2
gentoo-1d5b43ab215e7062d48a581b18f69df4eccb40ac.zip
python*r1.eclass: Reliably allow empty <pattern>s to gen funcs
Reliably allow empty pattern lists (equivalent to no restrictions) in all pattern-based generator functions, notably python_gen_cond_dep. Previously, only some of the functions accepted them while others failed via _python_impl_matches function. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r--eclass/python-r1.eclass13
1 files changed, 6 insertions, 7 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index ea4d1e3d4e41..479c4d08234b 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -278,7 +278,7 @@ _python_validate_useflags() {
# @FUNCTION: _python_gen_usedep
# @INTERNAL
-# @USAGE: <pattern> [...]
+# @USAGE: [<pattern>...]
# @DESCRIPTION:
# Output a USE dependency string for Python implementations which
# are both in PYTHON_COMPAT and match any of the patterns passed
@@ -353,7 +353,7 @@ python_gen_usedep() {
}
# @FUNCTION: python_gen_useflags
-# @USAGE: <pattern> [...]
+# @USAGE: [<pattern>...]
# @DESCRIPTION:
# Output a list of USE flags for Python implementations which
# are both in PYTHON_COMPAT and match any of the patterns passed
@@ -390,7 +390,7 @@ python_gen_useflags() {
}
# @FUNCTION: python_gen_cond_dep
-# @USAGE: <dependency> <pattern> [...]
+# @USAGE: <dependency> [<pattern>...]
# @DESCRIPTION:
# Output a list of <dependency>-ies made conditional to USE flags
# of Python implementations which are both in PYTHON_COMPAT and match
@@ -486,9 +486,8 @@ python_gen_impl_dep() {
local PYTHON_REQ_USE=${1}
shift
- local patterns=( "${@-*}" )
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
- if _python_impl_matches "${impl}" "${patterns[@]}"; then
+ if _python_impl_matches "${impl}" "${@}"; then
local PYTHON_PKG_DEP
python_export "${impl}" PYTHON_PKG_DEP
matches+=( "python_targets_${impl}? ( ${PYTHON_PKG_DEP} )" )
@@ -566,7 +565,7 @@ python_gen_any_dep() {
local i PYTHON_PKG_DEP out=
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
- if _python_impl_matches "${i}" "${@-*}"; then
+ if _python_impl_matches "${i}" "${@}"; then
local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
python_export "${i}" PYTHON_PKG_DEP
@@ -763,7 +762,7 @@ python_setup() {
fi
# check patterns
- _python_impl_matches "${impl}" "${@-*}" || continue
+ _python_impl_matches "${impl}" "${@}" || continue
python_export "${impl}" EPYTHON PYTHON