summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-02-04 18:43:52 +0100
committerMichał Górny <mgorny@gentoo.org>2022-02-09 09:43:50 +0100
commit072aacf0f7de7dde594513182851e9f6b519ef26 (patch)
treec63b30adc7e22abdf8fdf8250156632ea1bef4f8 /eclass/python-r1.eclass
parentpython-single-r1.eclass: Inline & simplify USE-deps in gen_cond_dep (diff)
downloadgentoo-072aacf0f7de7dde594513182851e9f6b519ef26.tar.gz
gentoo-072aacf0f7de7dde594513182851e9f6b519ef26.tar.bz2
gentoo-072aacf0f7de7dde594513182851e9f6b519ef26.zip
python-r1.eclass: Improve comment for USE-dep generation
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r--eclass/python-r1.eclass12
1 files 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}}