2020-04-24 23:36:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# All rust-related downloads can be found at
|
|
|
|
# https://static.rust-lang.org/dist/index.html. To find the date on
|
|
|
|
# which a particular thing was last updated, look for the *-date.txt
|
|
|
|
# file, e.g.
|
|
|
|
# https://static.rust-lang.org/dist/channel-rust-beta-date.txt
|
|
|
|
|
|
|
|
PLATFORMS=(
|
|
|
|
i686-unknown-linux-gnu
|
|
|
|
x86_64-unknown-linux-gnu
|
2021-02-05 17:12:51 +00:00
|
|
|
x86_64-unknown-linux-musl
|
2020-04-24 23:36:52 +00:00
|
|
|
arm-unknown-linux-gnueabihf
|
|
|
|
armv7-unknown-linux-gnueabihf
|
|
|
|
aarch64-unknown-linux-gnu
|
2021-02-05 17:12:51 +00:00
|
|
|
aarch64-unknown-linux-musl
|
2020-04-24 23:36:52 +00:00
|
|
|
x86_64-apple-darwin
|
2021-04-26 19:14:03 +00:00
|
|
|
aarch64-apple-darwin
|
2020-11-06 00:33:48 +00:00
|
|
|
powerpc64le-unknown-linux-gnu
|
2021-06-01 10:57:12 +00:00
|
|
|
riscv64gc-unknown-linux-gnu
|
2022-03-30 09:31:56 +00:00
|
|
|
mips64el-unknown-linux-gnuabi64
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
BASEURL=https://static.rust-lang.org/dist
|
|
|
|
VERSION=${1:-}
|
|
|
|
DATE=${2:-}
|
|
|
|
|
|
|
|
if [[ -z $VERSION ]]
|
|
|
|
then
|
|
|
|
echo "No version supplied"
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n $DATE ]]
|
|
|
|
then
|
|
|
|
BASEURL=$BASEURL/$DATE
|
|
|
|
fi
|
|
|
|
|
|
|
|
for PLATFORM in "${PLATFORMS[@]}"
|
|
|
|
do
|
|
|
|
URL="$BASEURL/rust-$VERSION-$PLATFORM.tar.gz.sha256"
|
|
|
|
SHA256=$(curl -sSfL $URL | cut -d ' ' -f 1)
|
|
|
|
echo "$PLATFORM = \"$SHA256\";"
|
|
|
|
done
|