about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicho Healey <richo@psych0tik.net>2015-03-28 19:56:17 -0700
committerRicho Healey <richo@psych0tik.net>2015-03-28 19:58:26 -0700
commitee3dffac4939c24d8c6412dc12dc1bd388494f40 (patch)
tree0715c16144e25f4dbee6d27b94747d0a7f2b45ac
parentfb78ca8b763e57c83d9269a97b9f374aeed7d0b2 (diff)
Add support for channel selection
-rwxr-xr-xsrc/etc/rustup.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/etc/rustup.sh b/src/etc/rustup.sh
index 9218f2549e1..df00ff97510 100755
--- a/src/etc/rustup.sh
+++ b/src/etc/rustup.sh
@@ -288,6 +288,7 @@ VAL_OPTIONS=""
 flag uninstall "only uninstall from the installation prefix"
 valopt prefix "" "set installation prefix"
 valopt date "" "use the YYYY-MM-DD nightly instead of the current nightly"
+valopt channel "nightly" "use the selected release channel [nightly]"
 flag save "save the downloaded nightlies to ~/.rustup"
 
 if [ $HELP -eq 1 ]
@@ -449,18 +450,25 @@ then
 fi
 
 RUST_URL="https://static.rust-lang.org/dist"
-RUST_PACKAGE_NAME=rust-nightly
+case "$CFG_CHANNEL" in
+    nightly)
+        # add a date suffix if we want a particular nighly.
+        if [ -n "${CFG_DATE}" ];
+        then
+            RUST_URL="${RUST_URL}/${CFG_DATE}"
+        fi
+
+        RUST_PACKAGE_NAME=rust-nightly
+        ;;
+    *)
+        err "Currently nightly is the only supported release channel"
+esac
+
 RUST_PACKAGE_NAME_AND_TRIPLE="${RUST_PACKAGE_NAME}-${HOST_TRIPLE}"
 RUST_TARBALL_NAME="${RUST_PACKAGE_NAME_AND_TRIPLE}.tar.gz"
 RUST_LOCAL_INSTALL_DIR="${CFG_TMP_DIR}/${RUST_PACKAGE_NAME_AND_TRIPLE}"
 RUST_LOCAL_INSTALL_SCRIPT="${RUST_LOCAL_INSTALL_DIR}/install.sh"
 
-# add a date suffix if we want a particular nighly.
-if [ -n "${CFG_DATE}" ];
-then
-    RUST_URL="${RUST_URL}/${CFG_DATE}"
-fi
-
 download_hash() {
     msg "Downloading ${remote_sha256}"
     remote_sha256=`"${CFG_CURL}" -f "${remote_sha256}"`