Changeset View
Changeset View
Standalone View
Standalone View
lang/rust/update.sh
#!/bin/sh | #!/bin/sh | ||||
# Requires: pkg install portfmt | # Requires: pkg install portfmt | ||||
# Run in lang/rust | # Run in lang/rust | ||||
set -eu | set -eu | ||||
get_commit() { | |||||
awk ' | |||||
$1 == "[pkg.rustc]" { pkg_rustc = 1 } | |||||
pkg_rustc && $1 == "git_commit_hash" { | |||||
print substr($3, 2, 10) | |||||
exit | |||||
}' | |||||
} | |||||
fetch -qo /tmp/channel-rust-stable.toml https://dev-static.rust-lang.org/dist/channel-rust-stable.toml | fetch -qo /tmp/channel-rust-stable.toml https://dev-static.rust-lang.org/dist/channel-rust-stable.toml | ||||
version=$(</tmp/channel-rust-stable.toml awk ' | version=$(</tmp/channel-rust-stable.toml tomlq -r '.pkg.rustc.version | split(" ")[0]') | ||||
$1 == "[pkg.rustc]" { pkg_rustc = 1 } | new_commit=$(</tmp/channel-rust-stable.toml tomlq -r '.pkg.rustc.git_commit_hash') | ||||
pkg_rustc && $1 == "version" { | |||||
print substr($3, 2, length($3) - 1) | |||||
exit | |||||
}') | |||||
new_commit=$(</tmp/channel-rust-stable.toml get_commit) | |||||
rm /tmp/channel-rust-stable.toml | rm /tmp/channel-rust-stable.toml | ||||
fetch -qo - https://raw.githubusercontent.com/rust-lang/rust/${new_commit}/src/stage0.txt | awk ' | fetch -qo - https://raw.githubusercontent.com/rust-lang/rust/${new_commit}/src/stage0.json | jq -r ' | ||||
$1 == "date:" { date = $2 } | "BOOTSTRAPS_DATE=\(.compiler.date)", | ||||
$1 == "rustc:" { rustc = $2 } | "RUST_BOOTSTRAP_VERSION=\(.compiler.version)" | ||||
END { printf("BOOTSTRAPS_DATE=%s\nRUST_BOOTSTRAP_VERSION=%s\n", date, rustc) }' | portedit merge -i . | ' | portedit merge -i . | ||||
sed -i '' -E -e "s,(\\$\\{RUST_DEFAULT\\}>=).*(:lang/\\$\\{RUST_DEFAULT\\}),\\1${version}\\2," \ | sed -i '' -E -e "s,(\\$\\{RUST_DEFAULT\\}>=).*(:lang/\\$\\{RUST_DEFAULT\\}),\\1${version}\\2," \ | ||||
../../Mk/Uses/cargo.mk ../../Mk/bsd.gecko.mk | ../../Mk/Uses/cargo.mk ../../Mk/bsd.gecko.mk | ||||
portedit set-version -i "${version}" . | portedit set-version -i "${version}" . | ||||
make makesum | |||||
portedit set-version -i "${version}" ../rust-bootstrap | portedit set-version -i "${version}" ../rust-bootstrap | ||||
make makesum | |||||
make -C ../rust-bootstrap makesum | make -C ../rust-bootstrap makesum | ||||
echo "lang/rust: Update to ${version} | echo "lang/rust: Update to ${version} | ||||
Changes: https://blog.rust-lang.org/FIXME/Rust-${version}.html | Changes: https://blog.rust-lang.org/FIXME/Rust-${version}.html | ||||
PR: FIXME | PR: FIXME | ||||
Exp-run by: antoine | Exp-run by: antoine | ||||
Differential Revision: FIXME" >rust.msg | Differential Revision: FIXME" >rust.msg |