commit:     9f09b98ee6a5edce65e995c4701776e8e1c86d1d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  7 12:22:52 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul 23 14:07:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f09b98e

llvm-r1.eclass: Do not default-enable unkeyworded slots

Change the IUSE defaults logic to default-enable the *oldest* ~arch
version rather than the newest one, when no stable slots are supported.
Since we only except a single ~arch version to exist, this effectively
prevents the eclass from default-enabling the unkeyworded snapshots.

Closes: https://bugs.gentoo.org/935681
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/37473
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/llvm-r1.eclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/eclass/llvm-r1.eclass b/eclass/llvm-r1.eclass
index 620697e6e045..0a53b9a3cb5e 100644
--- a/eclass/llvm-r1.eclass
+++ b/eclass/llvm-r1.eclass
@@ -123,11 +123,16 @@ _llvm_set_globals() {
        fi
 
        if [[ ${stable[@]} ]]; then
+               # If there is at least one stable slot supported, then enable
+               # the newest stable slot by default.
                IUSE="+llvm_slot_${stable[-1]}"
                unset 'stable[-1]'
        else
-               IUSE="+llvm_slot_${unstable[-1]}"
-               unset 'unstable[-1]'
+               # Otherwise, enable the "oldest" ~arch slot.  We really only
+               # expect a single ~arch version, so this primarily prevents
+               # defaulting to non-keyworded slots.
+               IUSE="+llvm_slot_${unstable[0]}"
+               unset 'unstable[0]'
        fi
        local nondefault=( "${stable[@]}" "${unstable[@]}" )
        IUSE+=" ${nondefault[*]/#/llvm_slot_}"

Reply via email to