summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/python-single-r1.eclass')
-rw-r--r--eclass/python-single-r1.eclass45
1 files changed, 3 insertions, 42 deletions
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index 574ee9cfc04e..73afcdc3ed6c 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-r1.eclass
@@ -259,40 +259,6 @@ unset -f _python_single_set_globals
if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
-# @FUNCTION: _python_gen_usedep
-# @USAGE: [<pattern>...]
-# @INTERNAL
-# @DESCRIPTION:
-# Output a USE dependency string for Python implementations which
-# are both in PYTHON_COMPAT and match any of the patterns passed
-# as parameters to the function.
-#
-# The patterns are fnmatch-style patterns (matched via bash
-# == operator against PYTHON_COMPAT values). Remember to escape
-# or quote the fnmatch patterns to prevent accidental shell filename
-# expansion.
-#
-# This is an internal function used to implement python_gen_cond_dep.
-_python_gen_usedep() {
- debug-print-function ${FUNCNAME} "${@}"
-
- local impl matches=()
-
- _python_verify_patterns "${@}"
- for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
- if _python_impl_matches "${impl}" "${@}"; then
- matches+=(
- "python_single_target_${impl}(-)?"
- )
- fi
- done
-
- [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}"
-
- local out=${matches[@]}
- echo "${out// /,}"
-}
-
# @FUNCTION: python_gen_useflags
# @USAGE: [<pattern>...]
# @DESCRIPTION:
@@ -372,13 +338,7 @@ python_gen_cond_dep() {
_python_verify_patterns "${@}"
for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
if _python_impl_matches "${impl}" "${@}"; then
- # substitute ${PYTHON_SINGLE_USEDEP} if used
- # (since python_gen_usedep() will not return
- # ${PYTHON_SINGLE_USEDEP}, the code is run at most once)
- if [[ ${dep} == *'${PYTHON_SINGLE_USEDEP}'* ]]; then
- local usedep=$(_python_gen_usedep "${@}")
- dep=${dep//\$\{PYTHON_SINGLE_USEDEP\}/${usedep}}
- fi
+ local single_usedep="python_single_target_${impl}(-)"
local multi_usedep="python_targets_${impl}(-)"
if [[ ${EAPI} != [67] ]]; then
@@ -387,7 +347,8 @@ python_gen_cond_dep() {
fi
fi
- local subdep=${dep//\$\{PYTHON_MULTI_USEDEP\}/${multi_usedep}}
+ local subdep=${dep//\$\{PYTHON_SINGLE_USEDEP\}/${single_usedep}}
+ subdep=${subdep//\$\{PYTHON_MULTI_USEDEP\}/${multi_usedep}}
matches+=( "python_single_target_${impl}? (
${subdep//\$\{PYTHON_USEDEP\}/${multi_usedep}} )" )
fi