diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-05-10 17:25:46 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-05-16 19:11:36 +0200 |
commit | 7adf37851c4208131f965bfbba5cace62780aef7 (patch) | |
tree | 3954120d55b78bc37f1972a226b2241eea9a25ac /eclass/python-single-r1.eclass | |
parent | python-single-r1.eclass: python_gen_useflags, use _python_impl_matches() (diff) | |
download | gentoo-7adf37851c4208131f965bfbba5cace62780aef7.tar.gz gentoo-7adf37851c4208131f965bfbba5cace62780aef7.tar.bz2 gentoo-7adf37851c4208131f965bfbba5cace62780aef7.zip |
python-single-r1.eclass: python_gen_cond_dep, use _python_impl_matches()
Diffstat (limited to 'eclass/python-single-r1.eclass')
-rw-r--r-- | eclass/python-single-r1.eclass | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass index e43057f26d6f..eeb827513380 100644 --- a/eclass/python-single-r1.eclass +++ b/eclass/python-single-r1.eclass @@ -374,8 +374,7 @@ python_gen_useflags() { python_gen_cond_dep() { debug-print-function ${FUNCNAME} "${@}" - local flag_prefix impl pattern - local matches=() + local flag_prefix impl matches=() if [[ ${#_PYTHON_SUPPORTED_IMPLS[@]} -eq 1 ]]; then flag_prefix=python_targets @@ -387,20 +386,17 @@ python_gen_cond_dep() { 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+=( "${flag_prefix}_${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+=( "${flag_prefix}_${impl}? ( ${dep} )" ) + fi done echo "${matches[@]}" |