From 72f4d054189d746bb40db44b565ca9c42f25a7a6 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 26 Feb 2018 16:08:10 +0000 Subject: [PATCH] Handle a too old system Git on OS X 10.8 and below Needed for GitHub since: https://github.com/blog/2507-weak-cryptographic-standards-removed --- Library/Homebrew/brew.sh | 8 ++++++++ Library/Homebrew/cmd/update.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index 61d85ddd2a..77a60dfc7f 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -96,6 +96,14 @@ then HOMEBREW_FORCE_BREWED_CURL="1" fi + # The system Git is too old for some GitHub's SSL ciphers on older + # macOS versions. + # https://github.com/blog/2507-weak-cryptographic-standards-removed + if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]] + then + HOMEBREW_SYSTEM_GIT_TOO_OLD="1" + fi + if [[ -z "$HOMEBREW_CACHE" ]] then HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew" diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 7477845274..cc7a86cf38 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -390,7 +390,7 @@ EOS brew install curl fi - if ! git --version >/dev/null 2>&1 + if [[ -n "$HOMEBREW_SYSTEM_GIT_TOO_OLD" ]] || ! git --version >/dev/null 2>&1 then # we cannot install brewed git if homebrew/core is unavailable. [[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] && brew install git