Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/4] python-any-r1.eclass: Fix unsupported/invalid EPYTHON logic
Date: Tue, 22 Feb 2022 23:30:25
Message-Id: 20220222233011.101456-1-mgorny@gentoo.org
1 Fix the unsupported/invalid EPYTHON logic to make more sense.
2 As a result of prior refactoring, the eclass would report all invalid
3 EPYTHON values as unsupported and the invalid branch would never
4 be reached -- except for the special case of python2_7 where it would
5 incorrectly reject it. Fix it, so that unsupported EPYTHON values
6 are reported either as "just unsupported" or incorrect values correctly.
7
8 Signed-off-by: Michał Górny <mgorny@g.o>
9 ---
10 eclass/python-any-r1.eclass | 8 +++++---
11 1 file changed, 5 insertions(+), 3 deletions(-)
12
13 diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
14 index 4e954f57cd2d..805981bb7aa8 100644
15 --- a/eclass/python-any-r1.eclass
16 +++ b/eclass/python-any-r1.eclass
17 @@ -302,9 +302,11 @@ python_setup() {
18 local epython_impl=${EPYTHON/./_}
19 if [[ ${epython_impl} ]]; then
20 if ! has "${epython_impl}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then
21 - einfo "EPYTHON (${EPYTHON}) not supported by the package"
22 - elif ! has "${epython_impl}" "${_PYTHON_ALL_IMPLS[@]}"; then
23 - ewarn "Invalid EPYTHON: ${EPYTHON}"
24 + if ! has "${epython_impl}" "${_PYTHON_ALL_IMPLS[@]}"; then
25 + ewarn "Invalid EPYTHON: ${EPYTHON}"
26 + else
27 + einfo "EPYTHON (${EPYTHON}) not supported by the package"
28 + fi
29 elif _python_run_check_deps "${epython_impl}"; then
30 _python_export EPYTHON PYTHON
31 _python_wrapper_setup
32 --
33 2.35.1

Replies