From b8fee7fe4d727a624943212ae21113a00e1e1e2f Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Tue, 23 May 2017 18:34:16 -0700 Subject: [PATCH 1/3] vendor-install: check -x on output of which This works around older versions of `which`, which return a string on failure. --- Library/Homebrew/cmd/vendor-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 8f08e49fb0..9ab004ee87 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -76,10 +76,10 @@ fetch() { trap - SIGINT fi - if [[ -n "$(which shasum)" ]] + if [[ -x "$(which shasum)" ]] then sha="$(shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)" - elif [[ -n "$(which sha256sum)" ]] + elif [[ -x "$(which sha256sum)" ]] then sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)" else From 6453c81dacc66ed892168351335482f83b087c34 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Thu, 11 May 2017 08:58:40 -0700 Subject: [PATCH 2/3] vendor-install: fix array syntax for old bash --- Library/Homebrew/cmd/vendor-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 9ab004ee87..46f0c72f9d 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -39,10 +39,10 @@ fetch() { if [[ -n "$HOMEBREW_QUIET" ]] then - curl_args+=(--silent) + curl_args[${#curl_args[*]}]="--silent" elif [[ -z "$HOMEBREW_VERBOSE" ]] then - curl_args+=(--progress-bar) + curl_args[${#curl_args[*]}]="--progress-bar" fi temporary_path="$CACHED_LOCATION.incomplete" From 7c7a0fc720f3d7be019b15343709fe4f45dafeff Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 10 May 2017 23:31:31 -0700 Subject: [PATCH 3/3] brew.sh: don't call xcode-select if it doesn't exist --- Library/Homebrew/brew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 02ce5e1c15..b762800993 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -145,7 +145,7 @@ export HOMEBREW_MACOS_VERSION export HOMEBREW_USER_AGENT export HOMEBREW_USER_AGENT_CURL -if [[ -n "$HOMEBREW_MACOS" ]] +if [[ -n "$HOMEBREW_MACOS" && -x "/usr/bin/xcode-select" ]] then XCODE_SELECT_PATH=$('/usr/bin/xcode-select' --print-path 2>/dev/null) if [[ "$XCODE_SELECT_PATH" = "/" ]]