diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-05-10 17:24:05 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-05-16 19:11:33 +0200 |
commit | 8a03543f3c9a7adbc73ecee5e6c693156011b389 (patch) | |
tree | 20eb7520c635a519529b847e0902a168b479322c /eclass/python-r1.eclass | |
parent | python-r1.eclass: python_gen_useflags, use _python_impl_matches() (diff) | |
download | gentoo-8a03543f3c9a7adbc73ecee5e6c693156011b389.tar.gz gentoo-8a03543f3c9a7adbc73ecee5e6c693156011b389.tar.bz2 gentoo-8a03543f3c9a7adbc73ecee5e6c693156011b389.zip |
python-r1.eclass: python_gen_cond_dep, use _python_impl_matches()
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r-- | eclass/python-r1.eclass | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 7ec77acd8665..2618c6f57033 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -364,27 +364,22 @@ python_gen_useflags() { python_gen_cond_dep() { debug-print-function ${FUNCNAME} "${@}" - local impl pattern - local matches=() - + local impl matches=() local dep=${1} shift for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do - for pattern; do - if [[ ${impl} == ${pattern} ]]; then - # substitute ${PYTHON_USEDEP} if used - # (since python_gen_usedep() will not return ${PYTHON_USEDEP} - # the code is run at most once) - if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then - local usedep=$(python_gen_usedep "${@}") - dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} - fi - - matches+=( "python_targets_${impl}? ( ${dep} )" ) - break + if _python_impl_matches "${impl}" "${@}"; then + # substitute ${PYTHON_USEDEP} if used + # (since python_gen_usedep() will not return ${PYTHON_USEDEP} + # the code is run at most once) + if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then + local usedep=$(python_gen_usedep "${@}") + dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} fi - done + + matches+=( "python_targets_${impl}? ( ${dep} )" ) + fi done echo "${matches[@]}" |