diff options
author | 2022-02-05 10:14:25 +0100 | |
---|---|---|
committer | 2022-02-09 09:43:56 +0100 | |
commit | f8e51b15e363e1cde95411927c21d620cb646f68 (patch) | |
tree | 2ae181b205f5a8ee15a76b8c7c38578cbf09e489 /eclass | |
parent | python-utils-r1.eclass: Support matching impls by stdlib version (diff) | |
download | gentoo-f8e51b15e363e1cde95411927c21d620cb646f68.tar.gz gentoo-f8e51b15e363e1cde95411927c21d620cb646f68.tar.bz2 gentoo-f8e51b15e363e1cde95411927c21d620cb646f68.zip |
python-any-r1.eclass: Do not test EPYTHON twice
Avoid checking the implementation from EPYTHON via fallback iteration.
While there's no technical harm in doing that, now that we output
verbosely the users will notice ;-).
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/python-any-r1.eclass | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass index 5c01e9eb6888..4e954f57cd2d 100644 --- a/eclass/python-any-r1.eclass +++ b/eclass/python-any-r1.eclass @@ -299,13 +299,13 @@ python_setup() { fi # first, try ${EPYTHON}... maybe it's good enough for us. - if [[ ${EPYTHON} ]]; then - local impl=${EPYTHON/./_} - if ! has "${impl}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then + local epython_impl=${EPYTHON/./_} + if [[ ${epython_impl} ]]; then + if ! has "${epython_impl}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then einfo "EPYTHON (${EPYTHON}) not supported by the package" - elif ! has "${impl}" "${_PYTHON_ALL_IMPLS[@]}"; then + elif ! has "${epython_impl}" "${_PYTHON_ALL_IMPLS[@]}"; then ewarn "Invalid EPYTHON: ${EPYTHON}" - elif _python_run_check_deps "${impl}"; then + elif _python_run_check_deps "${epython_impl}"; then _python_export EPYTHON PYTHON _python_wrapper_setup einfo "Using ${EPYTHON} to build (via EPYTHON)" @@ -313,10 +313,12 @@ python_setup() { fi fi - # fallback to best installed impl. + # fallback to the best installed impl. # (reverse iteration over _PYTHON_SUPPORTED_IMPLS) for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do local impl=${_PYTHON_SUPPORTED_IMPLS[i]} + # avoid checking EPYTHON twice + [[ ${impl} == ${epython_impl} ]] && continue _python_export "${impl}" EPYTHON PYTHON if _python_run_check_deps "${impl}"; then _python_wrapper_setup |