commit:     072aacf0f7de7dde594513182851e9f6b519ef26
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  4 17:43:52 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Feb  9 08:43:50 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=072aacf0

python-r1.eclass: Improve comment for USE-dep generation

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/python-r1.eclass | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 469c3014abfb..bb851e167617 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -393,9 +393,15 @@ python_gen_cond_dep() {
        _python_verify_patterns "${@}"
        for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
                if _python_impl_matches "${impl}" "${@}"; then
-                       # substitute ${PYTHON_USEDEP} if used
-                       # (since python_gen_usedep() will not return 
${PYTHON_USEDEP}
-                       #  the code is run at most once)
+                       # substitute ${PYTHON_USEDEP} with USE-dep on *all* 
matching
+                       # targets, if it is used.  this ensures that Portage 
will
+                       # report all missing USE flags simultaneously rather 
than
+                       # requesting the user to enable them one by one.
+                       #
+                       # NB: the first call with replace all instances
+                       # of ${PYTHON_USEDEP}, so the condition will be false
+                       # on subsequent loop iterations and _python_gen_usedep()
+                       # will run at most once.
                        if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then
                                local usedep=$(_python_gen_usedep "${@}")
                                dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}}

Reply via email to