commit: f8e51b15e363e1cde95411927c21d620cb646f68
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 5 09:14:25 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb 9 08:43:56 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8e51b15
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 <AT> gentoo.org>
eclass/python-any-r1.eclass | 14 ++++++++------
1 file 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