From 479f82904bacd9096e3ef7707644d93c75032cb8 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Fri, 17 Aug 2018 14:59:07 -0400 Subject: [PATCH] brew.sh: Allow developers to specify curl/git paths This introduces the HOMEBREW_CURL_PATH and HOMEBREW_GIT_PATH variables, which are used to populate HOMEBREW_CURL and HOMEBREW_GIT, respectively, when in developer mode (HOMEBREW_DEVELOPER). Both paths are expected to be valid executables and must have the executable bit set. --- Library/Homebrew/brew.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 6618819e64..c476aabf07 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -129,6 +129,11 @@ else HOMEBREW_CURL="curl" fi +if [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_CURL_PATH" ]] +then + HOMEBREW_CURL="$HOMEBREW_CURL_PATH" +fi + if [[ -n "$HOMEBREW_FORCE_BREWED_GIT" && -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]] && "$HOMEBREW_PREFIX/opt/git/bin/git" --version >/dev/null @@ -138,6 +143,11 @@ else HOMEBREW_GIT="git" fi +if [[ -n "$HOMEBREW_DEVELOPER" && -x "$HOMEBREW_GIT_PATH" ]] +then + HOMEBREW_GIT="$HOMEBREW_GIT_PATH" +fi + HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_USER_AGENT_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_USER_AGENT_VERSION)" HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | awk '{print $1"/"$2}')" HOMEBREW_USER_AGENT_CURL="$HOMEBREW_USER_AGENT $HOMEBREW_CURL_VERSION"