Skip to content

Commit d55ffa9

Browse files
committed
rollup merge of #23944: alexcrichton/rustup-beta
Switches rustup to using the beta channel by default. Includes #23824 for the implementation. cc #20453 Closes #21149
2 parents a3e5b35 + 971c355 commit d55ffa9

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/etc/rustup.sh

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ VAL_OPTIONS=""
288288
flag uninstall "only uninstall from the installation prefix"
289289
valopt prefix "" "set installation prefix"
290290
valopt date "" "use the YYYY-MM-DD nightly instead of the current nightly"
291+
valopt channel "beta" "use the selected release channel [beta]"
291292
flag save "save the downloaded nightlies to ~/.rustup"
292293

293294
if [ $HELP -eq 1 ]
@@ -307,7 +308,7 @@ CFG_CPUTYPE=$(uname -m)
307308

308309
if [ $CFG_OSTYPE = Darwin -a $CFG_CPUTYPE = i386 ]
309310
then
310-
# Darwin's `uname -s` lies and always returns i386. We have to use sysctl
311+
# Darwin's `uname -m` lies and always returns i386. We have to use sysctl
311312
# instead.
312313
if sysctl hw.optional.x86_64 | grep -q ': 1'
313314
then
@@ -449,18 +450,28 @@ then
449450
fi
450451

451452
RUST_URL="https://static.rust-lang.org/dist"
452-
RUST_PACKAGE_NAME=rust-nightly
453+
case "$CFG_CHANNEL" in
454+
nightly)
455+
# add a date suffix if we want a particular nightly.
456+
if [ -n "${CFG_DATE}" ];
457+
then
458+
RUST_URL="${RUST_URL}/${CFG_DATE}"
459+
fi
460+
461+
RUST_PACKAGE_NAME=rust-nightly
462+
;;
463+
beta)
464+
RUST_PACKAGE_NAME=rust-1.0.0-beta
465+
;;
466+
*)
467+
err "Currently 'beta' and 'nightly' are the only supported channels"
468+
esac
469+
453470
RUST_PACKAGE_NAME_AND_TRIPLE="${RUST_PACKAGE_NAME}-${HOST_TRIPLE}"
454471
RUST_TARBALL_NAME="${RUST_PACKAGE_NAME_AND_TRIPLE}.tar.gz"
455472
RUST_LOCAL_INSTALL_DIR="${CFG_TMP_DIR}/${RUST_PACKAGE_NAME_AND_TRIPLE}"
456473
RUST_LOCAL_INSTALL_SCRIPT="${RUST_LOCAL_INSTALL_DIR}/install.sh"
457474

458-
# add a date suffix if we want a particular nighly.
459-
if [ -n "${CFG_DATE}" ];
460-
then
461-
RUST_URL="${RUST_URL}/${CFG_DATE}"
462-
fi
463-
464475
download_hash() {
465476
msg "Downloading ${remote_sha256}"
466477
remote_sha256=`"${CFG_CURL}" -f "${remote_sha256}"`

0 commit comments

Comments
 (0)