1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-05 06:27:37 +00:00
freebsd-ports/lang/rust/update.sh
Tobias Kortkamp 922686e800
USES=cargo: Fix CARGO_BUILDDEP=any-version
Fix update.sh to only replace the first version.
2022-11-08 10:12:59 +01:00

35 lines
1.1 KiB
Bash

#!/bin/sh
# Requires: pkg install portfmt yq
# Run in lang/rust
set -eu
fetch -qo /tmp/channel-rust-stable.toml https://dev-static.rust-lang.org/dist/channel-rust-stable.toml
version=$(</tmp/channel-rust-stable.toml tomlq -r '.pkg.rustc.version | split(" ")[0]')
new_commit=$(</tmp/channel-rust-stable.toml tomlq -r '.pkg.rustc.git_commit_hash')
rm /tmp/channel-rust-stable.toml
fetch -qo - https://raw.githubusercontent.com/rust-lang/rust/${new_commit}/src/stage0.json | jq -r '
"BOOTSTRAPS_DATE=\(.compiler.date)",
"RUST_BOOTSTRAP_VERSION=\(.compiler.version)"
' | portedit merge -i .
cat <<EOF | sed -i '' -E -f - ../../Mk/Uses/cargo.mk ../../Mk/bsd.gecko.mk
1,/\\$\\{RUST_DEFAULT\\}>=/ {
s,(\\$\\{RUST_DEFAULT\\}>=).*(:lang/\\$\\{RUST_DEFAULT\\}),\\1${version}\\2,
}
EOF
portedit set-version -i "${version}" .
portedit set-version -i "${version}" ../rust-bootstrap
make makesum
make -C ../rust-bootstrap makesum
echo "lang/rust: Update to ${version}
https://blog.rust-lang.org/FIXME/Rust-${version}.html
PR: FIXME
Exp-run by: antoine
Differential Revision: FIXME" >rust.msg