Enforce proper USE dependencies on dev-lang/python-exec from
python-any-r1.  While we force all flags being enabled on it, there is
still a possibility of temporary missync while a new target is being
added.  The explicit dependency should be harmless and ensure correct
package ordering, therefore avoiding errors like:

    python-exec: EPYTHON value invalid (python3.10).

Closes: https://bugs.gentoo.org/830273
Signed-off-by: Michał Górny <[email protected]>
---
 eclass/python-any-r1.eclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 7af9474d9a1f..3d46a2eb4ca0 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -181,7 +181,12 @@ _python_any_set_globals() {
                _python_export "${i}" PYTHON_PKG_DEP
 
                # note: need to strip '=' slot operator for || deps
-               deps="${PYTHON_PKG_DEP/:0=/:0} ${deps}"
+               deps="
+                       (
+                               ${PYTHON_PKG_DEP/:0=/:0}
+                               >=dev-lang/python-exec-2[python_targets_${i}]
+                       )
+                       ${deps}"
        done
        deps="|| ( ${deps})"
 
@@ -266,7 +271,13 @@ python_gen_any_dep() {
                local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
                
i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}}
                # note: need to strip '=' slot operator for || deps
-               out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}"
+               out="
+                       (
+                               ${PYTHON_PKG_DEP%=}
+                               >=dev-lang/python-exec-2[python_targets_${i}]
+                               ${i_depstr}
+                       )
+                       ${out}"
        done
        echo "|| ( ${out})"
 }
-- 
2.34.1


Reply via email to