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 18/30] python-r1.eclass: Improve comment for USE-dep generation
Date: Sun, 06 Feb 2022 12:54:37
Message-Id: 20220206124841.1299133-19-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/30] One batch of Python eclass updates to rule them all by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/python-r1.eclass | 12 +++++++++---
4 1 file changed, 9 insertions(+), 3 deletions(-)
5
6 diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
7 index 469c3014abfb..bb851e167617 100644
8 --- a/eclass/python-r1.eclass
9 +++ b/eclass/python-r1.eclass
10 @@ -393,9 +393,15 @@ python_gen_cond_dep() {
11 _python_verify_patterns "${@}"
12 for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
13 if _python_impl_matches "${impl}" "${@}"; then
14 - # substitute ${PYTHON_USEDEP} if used
15 - # (since python_gen_usedep() will not return ${PYTHON_USEDEP}
16 - # the code is run at most once)
17 + # substitute ${PYTHON_USEDEP} with USE-dep on *all* matching
18 + # targets, if it is used. this ensures that Portage will
19 + # report all missing USE flags simultaneously rather than
20 + # requesting the user to enable them one by one.
21 + #
22 + # NB: the first call with replace all instances
23 + # of ${PYTHON_USEDEP}, so the condition will be false
24 + # on subsequent loop iterations and _python_gen_usedep()
25 + # will run at most once.
26 if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then
27 local usedep=$(_python_gen_usedep "${@}")
28 dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}}
29 --
30 2.35.1