summaryrefslogtreecommitdiff
path: root/lang/rust-bootstrap/sync.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lang/rust-bootstrap/sync.sh')
-rw-r--r--lang/rust-bootstrap/sync.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/lang/rust-bootstrap/sync.sh b/lang/rust-bootstrap/sync.sh
index 80b0471e1015..258f9b7cbc61 100644
--- a/lang/rust-bootstrap/sync.sh
+++ b/lang/rust-bootstrap/sync.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# Requires: pkg install yq
# Upload Rust bootstraps available on pkg.FreeBSD.org to your
# ~/public_distfiles on freefall for the next lang/rust update.
# Change ABI below to select from which build to fetch the packages
@@ -7,8 +8,15 @@ set -xeu
: "${PORTSDIR=/usr/ports}"
: "${DATADIR=/tmp/rust-bootstrap}"
+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 /tmp/stage0 https://raw.githubusercontent.com/rust-lang/rust/${new_commit}/src/stage0
+date=$(awk -F "=" /^compiler_date/'{print $2}' /tmp/stage0)
+
version=$(make -C "${PORTSDIR}/lang/rust" -V PORTVERSION)
-date=$(fetch -qo- https://static.rust-lang.org/dist/channel-rust-stable-date.txt)
export ABI=FreeBSD:13:amd64
export INSTALL_AS_USER=1