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.
This commit is contained in:
William Woodruff 2018-08-17 14:59:07 -04:00
parent a11039d854
commit 479f82904b
No known key found for this signature in database
GPG Key ID: 70F70A3979DDCED3

View File

@ -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"