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