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] python-r1.eclass: Fix any-r1-style python_setup without USE flags
Date: Mon, 08 Mar 2021 10:05:54
Message-Id: 20210308100543.94901-1-mgorny@gentoo.org
1 Fix python_setup() not to fail if no USE flags are set while any-r1 API
2 is being used. Reported by Arfrever.
3
4 Signed-off-by: Michał Górny <mgorny@g.o>
5 ---
6 eclass/python-r1.eclass | 11 +++++++----
7 1 file changed, 7 insertions(+), 4 deletions(-)
8
9 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
10 index 74e3fb38a1cc..5457b515a839 100644
11 --- a/eclass/python-r1.eclass
12 +++ b/eclass/python-r1.eclass
13 @@ -771,15 +771,18 @@ python_foreach_impl() {
14 python_setup() {
15 debug-print-function ${FUNCNAME} "${@}"
16
17 - _python_validate_useflags
18 + local has_check_deps
19 + declare -f python_check_deps >/dev/null && has_check_deps=1
20 +
21 + if [[ ! ${has_check_deps} ]]; then
22 + _python_validate_useflags
23 + fi
24 +
25 local pycompat=( "${PYTHON_COMPAT[@]}" )
26 if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
27 pycompat=( ${PYTHON_COMPAT_OVERRIDE} )
28 fi
29
30 - local has_check_deps
31 - declare -f python_check_deps >/dev/null && has_check_deps=1
32 -
33 # (reverse iteration -- newest impl first)
34 local found
35 _python_verify_patterns "${@}"
36 --
37 2.30.1