diff options
| author | Mike McQuaid | 2017-11-26 18:17:25 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2017-11-26 18:17:26 +0000 |
| commit | a19d0708a4888f42d8e5d1ff082a7a5aed73279e (patch) | |
| tree | 6f0582a5e381a08ec5768e41232e4dd4fba5f903 /Library | |
| parent | 7f1d5903ff34a06e241a5cbae20d44b67656d773 (diff) | |
| download | brew-a19d0708a4888f42d8e5d1ff082a7a5aed73279e.tar.bz2 | |
Allow optionally using Homebrew's curl
If `HOMEBREW_FORCE_BREWED_CURL` is set then allow it to be used instead
of the system `curl`.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/brew.sh | 10 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 13 |
2 files changed, 13 insertions, 10 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 37fa7ed23..bd88a23f5 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -110,16 +110,18 @@ then # Don't change this from Mac OS X to match what macOS itself does in Safari on 10.12 HOMEBREW_OS_USER_AGENT_VERSION="Mac OS X $HOMEBREW_MACOS_VERSION" + # The system Curl is too old for some modern HTTPS certificates on + # older macOS versions. printf -v HOMEBREW_MACOS_VERSION_NUMERIC "%02d%02d%02d" ${HOMEBREW_MACOS_VERSION//./ } if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101000" ]] then HOMEBREW_SYSTEM_CURL_TOO_OLD="1" + HOMEBREW_FORCE_BREWED_CURL="1" fi - # The system Curl is too old for some modern HTTPS certificates on - # older macOS versions. - if [[ -n "$HOMEBREW_SYSTEM_CURL_TOO_OLD" && - -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] + if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" && + -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] && + "$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null then HOMEBREW_CURL="$HOMEBREW_PREFIX/opt/curl/bin/curl" fi diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 3507fa92b..609e4094a 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -383,14 +383,15 @@ user account: EOS fi + # we may want to use a Homebrew curl + if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" && + ! -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] + then + brew install curl + fi + if ! git --version >/dev/null 2>&1 then - # we need a new enough curl to install git - if [[ -n "$HOMEBREW_SYSTEM_CURL_TOO_OLD" && - ! -x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] - then - brew install curl - fi # we cannot install brewed git if homebrew/core is unavailable. [[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] && brew install git unset GIT_EXECUTABLE |
