From 68599ae8e909a309fd16f5516c68ca1acfb8aacf Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Sun, 28 Jun 2015 20:41:30 -0700 Subject: [PATCH 1/2] Handle $SHELL being set but not an absolute path. On Dash run from zsh on Debian, $SHELL can be just 'sh' which causes the platform to be incorrectly assumed to be i686 even when it's actually 64-bit. --- rustup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustup.sh b/rustup.sh index 393632b..610f30a 100755 --- a/rustup.sh +++ b/rustup.sh @@ -1014,7 +1014,7 @@ get_architecture() { # if configure is running in an interactive bash shell. /usr/bin/env # exists *everywhere*. local _bin_to_probe="$SHELL" - if [ -z "$_bin_to_probe" -a -e "/usr/bin/env" ]; then + if [ ! -e "$_bin_to_probe" -a -e "/usr/bin/env" ]; then _bin_to_probe="/usr/bin/env" fi if [ -n "$_bin_to_probe" ]; then From 24161b96514a55d321fa5e9dc649a8ef8c963893 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 29 Jun 2015 23:07:42 -0700 Subject: [PATCH 2/2] Don't look at binaries to determine arch unless they exist --- rustup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustup.sh b/rustup.sh index 610f30a..7ab1ac7 100755 --- a/rustup.sh +++ b/rustup.sh @@ -1017,7 +1017,7 @@ get_architecture() { if [ ! -e "$_bin_to_probe" -a -e "/usr/bin/env" ]; then _bin_to_probe="/usr/bin/env" fi - if [ -n "$_bin_to_probe" ]; then + if [ -e "$_bin_to_probe" ]; then file -L "$_bin_to_probe" | grep -q "x86[_-]64" if [ $? != 0 ]; then local _cputype=i686