2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-04 15:02:27 +00:00

rust: better bootstrap detection

This commit is contained in:
Owen Rafferty 2022-07-05 22:20:59 -05:00
parent 1094aa35d1
commit 945d835cd7
No known key found for this signature in database
GPG Key ID: A68B10E2554DEBCB

View File

@ -39,9 +39,16 @@ profiler = false
full-bootstrap = false full-bootstrap = false
EOF EOF
# If possible, use local rust to bootstrap. maj="${2%%.*}"
case $(rustc --version 2>/dev/null) in min="${2%.*}"
*1.62*|*1.61*) min="${min#*.}"
rust_version=$(rustc --version 2>/dev/null) || rust_version=null
rust_version="${rust_version#rustc }"
# If possible, use system rust to bootstrap.
case "$rust_version" in
$2|$maj.$(($min - 1)).*)
cat >> config.toml <<EOF cat >> config.toml <<EOF
cargo = "/usr/bin/cargo" cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc" rustc = "/usr/bin/rustc"