commit:     7c7e11e46ad664457ccf4954e5bc346c148cff2d
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 11 20:50:47 2024 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 23:39:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c7e11e4

rust.eclass: define `usedep` before its first usage

The open-ended dependency (no `RUST_MAX_VER`) was generated
before `usedep` was set to anything. Define `usedep` when
the variable is initialised and let the `RUST_NEEDS_LLVM`
path set it per llvm slot as required.

Closes: https://bugs.gentoo.org/943289
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 eclass/rust.eclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eclass/rust.eclass b/eclass/rust.eclass
index f7c2d6e9a80e..791af971eb3d 100644
--- a/eclass/rust.eclass
+++ b/eclass/rust.eclass
@@ -193,7 +193,7 @@ _rust_set_globals() {
        local rust_dep=()
        local llvm_slot
        local rust_slot
-       local usedep
+       local usedep="${RUST_REQ_USE+[${RUST_REQ_USE}]}"
 
        # If we're not using LLVM, we can just generate a simple Rust dependency
        if [[ -z "${RUST_NEEDS_LLVM}" ]]; then
@@ -209,7 +209,6 @@ _rust_set_globals() {
                        # depend on each slot between RUST_MIN_VER and 
RUST_MAX_VER; it's a bit specific but
                        # won't hurt as we only ever add newer Rust slots.
                        for slot in "${_RUST_SLOTS[@]}"; do
-                               usedep="${RUST_REQ_USE+[${RUST_REQ_USE}]}"
                                rust_dep+=(
                                        "dev-lang/rust-bin:${slot}${usedep}"
                                        "dev-lang/rust:${slot}${usedep}"

Reply via email to