commit:     de44f942e970e88cd1cd8898c8a98b7642370b82
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 20 17:28:29 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 20 17:29:21 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de44f942

dev-lang/rust-bin: search for rust-analyzer only if exists

Closes: https://bugs.gentoo.org/951083
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 dev-lang/rust-bin/rust-bin-1.85.0-r1.ebuild | 6 ++++--
 dev-lang/rust-bin/rust-bin-1.85.1.ebuild    | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dev-lang/rust-bin/rust-bin-1.85.0-r1.ebuild 
b/dev-lang/rust-bin/rust-bin-1.85.0-r1.ebuild
index e37377ab23b7..f76a83693d43 100644
--- a/dev-lang/rust-bin/rust-bin-1.85.0-r1.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.85.0-r1.ebuild
@@ -173,13 +173,15 @@ patchelf_for_bin() {
 
 rust_native_abi_install() {
        pushd "${S}" >/dev/null || die
-       local analysis="$(grep 'analysis' ./components || die "analysis not 
found in components")"
        local std="$(grep 'std' ./components || die "std not found in 
components")"
        local components=( "rustc" "cargo" "${std}" )
        use doc && components+=( "rust-docs" )
        use clippy && components+=( "clippy-preview" )
        use rustfmt && components+=( "rustfmt-preview" )
-       use rust-analyzer && components+=( "rust-analyzer-preview" 
"${analysis}" )
+       if use rust-analyzer; then
+               local analysis="$(grep 'analysis' ./components || die "analysis 
not found in components")"
+               components+=( "rust-analyzer-preview" "${analysis}" )
+       fi
        # Rust component 'rust-src' is extracted from separate archive
        if use rust-src; then
                einfo "Combining rust and rust-src installers"

diff --git a/dev-lang/rust-bin/rust-bin-1.85.1.ebuild 
b/dev-lang/rust-bin/rust-bin-1.85.1.ebuild
index f32073895f0f..614b762194a8 100644
--- a/dev-lang/rust-bin/rust-bin-1.85.1.ebuild
+++ b/dev-lang/rust-bin/rust-bin-1.85.1.ebuild
@@ -173,13 +173,15 @@ patchelf_for_bin() {
 
 rust_native_abi_install() {
        pushd "${S}" >/dev/null || die
-       local analysis="$(grep 'analysis' ./components || die "analysis not 
found in components")"
        local std="$(grep 'std' ./components || die "std not found in 
components")"
        local components=( "rustc" "cargo" "${std}" )
        use doc && components+=( "rust-docs" )
        use clippy && components+=( "clippy-preview" )
        use rustfmt && components+=( "rustfmt-preview" )
-       use rust-analyzer && components+=( "rust-analyzer-preview" 
"${analysis}" )
+       if use rust-analyzer; then
+               local analysis="$(grep 'analysis' ./components || die "analysis 
not found in components")"
+               components+=( "rust-analyzer-preview" "${analysis}" )
+       fi
        # Rust component 'rust-src' is extracted from separate archive
        if use rust-src; then
                einfo "Combining rust and rust-src installers"

Reply via email to