summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-01 10:30:11 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-01 10:30:11 -0700
commitc054ae2fa498ee32f5f26cba4cd3e442df4c59e9 (patch)
tree92326a5819388cba50dabd6c8d7c4a65d69c49dc /src/etc
parent89436536246250ee3cbc47a61c31037ce7558c06 (diff)
parentee3dffac4939c24d8c6412dc12dc1bd388494f40 (diff)
downloadrust-c054ae2fa498ee32f5f26cba4cd3e442df4c59e9.tar.gz
rust-c054ae2fa498ee32f5f26cba4cd3e442df4c59e9.zip
Merge branch 'fix-rustup' of https://github.com/richo/rust
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/rustup.sh24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/etc/rustup.sh b/src/etc/rustup.sh
index 47e64547eed..0ae7a238973 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 ]
@@ -307,7 +308,7 @@ CFG_CPUTYPE=$(uname -m)
 
 if [ $CFG_OSTYPE = Darwin -a $CFG_CPUTYPE = i386 ]
 then
-    # Darwin's `uname -s` lies and always returns i386. We have to use sysctl
+    # Darwin's `uname -m` lies and always returns i386. We have to use sysctl
     # instead.
     if sysctl hw.optional.x86_64 | grep -q ': 1'
     then
@@ -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}"`