Unify flags[@] and downgrade[@]

This commit is contained in:
David Tolnay
2026-10-08 21:43:28 -04:00
parent 83d06109b7
commit 6af9a09a9f
+2 -3
View File
@@ -85,12 +85,11 @@ runs:
flags=() flags=()
for t in ${targets//,/ }; do flags+=(--target "$t"); done for t in ${targets//,/ }; do flags+=(--target "$t"); done
for c in ${components//,/ }; do flags+=(--component "$c"); done for c in ${components//,/ }; do flags+=(--component "$c"); done
downgrade=() if [[ $toolchain == nightly && -n $components ]]; then flags+=(--allow-downgrade); fi
if [[ $toolchain == nightly && -n $components ]]; then downgrade=(--allow-downgrade); fi
log=$(mktemp) log=$(mktemp)
trap 'rm -f "$log"' EXIT trap 'rm -f "$log"' EXIT
for attempt in 1 2 3 4 5; do for attempt in 1 2 3 4 5; do
if rustup toolchain install "$toolchain" "${flags[@]}" --profile minimal "${downgrade[@]}" --no-self-update --force-non-host 2>&1 | tee "$log"; then if rustup toolchain install "$toolchain" "${flags[@]}" --profile minimal --no-self-update --force-non-host 2>&1 | tee "$log"; then
break break
else else
status=$? status=$?