2017-05-30 15:48:06 +02:00
|
|
|
#!/usr/bin/env bash
|
2017-10-04 18:41:16 +02:00
|
|
|
set -euo pipefail
|
2017-05-30 15:48:06 +02:00
|
|
|
|
|
|
|
# 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
|
2016-06-07 20:42:51 +02:00
|
|
|
|
2017-10-04 18:41:16 +02:00
|
|
|
PLATFORMS=(
|
|
|
|
i686-unknown-linux-gnu
|
|
|
|
x86_64-unknown-linux-gnu
|
2018-01-16 13:17:40 +01:00
|
|
|
armv7-unknown-linux-gnueabihf
|
2017-12-02 13:46:33 +01:00
|
|
|
aarch64-unknown-linux-gnu
|
2017-10-04 18:41:16 +02:00
|
|
|
i686-apple-darwin
|
|
|
|
x86_64-apple-darwin
|
|
|
|
)
|
|
|
|
BASEURL=https://static.rust-lang.org/dist
|
|
|
|
VERSION=${1:-}
|
|
|
|
DATE=${2:-}
|
2017-05-30 15:48:06 +02:00
|
|
|
|
2017-10-04 18:41:16 +02:00
|
|
|
if [[ -z $VERSION ]]
|
2017-05-30 15:48:06 +02:00
|
|
|
then
|
2017-10-04 18:41:16 +02:00
|
|
|
echo "No version supplied"
|
2017-05-30 15:48:06 +02:00
|
|
|
exit -1
|
|
|
|
fi
|
2016-06-07 20:42:51 +02:00
|
|
|
|
2017-10-04 18:41:16 +02:00
|
|
|
if [[ -n $DATE ]]
|
2016-06-07 20:42:51 +02:00
|
|
|
then
|
2017-10-04 18:41:16 +02:00
|
|
|
BASEURL=$BASEURL/$DATE
|
2016-06-07 20:42:51 +02:00
|
|
|
fi
|
|
|
|
|
2017-10-04 18:41:16 +02:00
|
|
|
for PLATFORM in "${PLATFORMS[@]}"
|
2016-06-07 20:42:51 +02:00
|
|
|
do
|
2017-10-04 18:41:16 +02:00
|
|
|
URL="$BASEURL/rust-$VERSION-$PLATFORM.tar.gz.sha256"
|
|
|
|
SHA256=$(curl -sSfL $URL | cut -d ' ' -f 1)
|
|
|
|
echo "$PLATFORM = \"$SHA256\";"
|
2016-06-07 20:42:51 +02:00
|
|
|
done
|