diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index ebea36c38c..942a8ae422 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -167,6 +167,7 @@ export HOMEBREW_PROCESSOR export HOMEBREW_PRODUCT export HOMEBREW_OS_VERSION export HOMEBREW_MACOS_VERSION +export HOMEBREW_MACOS_VERSION_NUMERIC export HOMEBREW_USER_AGENT export HOMEBREW_USER_AGENT_CURL diff --git a/Library/Homebrew/shims/scm/git b/Library/Homebrew/shims/scm/git index 7306268fda..0930c0adc3 100755 --- a/Library/Homebrew/shims/scm/git +++ b/Library/Homebrew/shims/scm/git @@ -122,12 +122,7 @@ then xcode_path="$(/usr/bin/xcode-select -print-path 2>/dev/null)" if [[ -z "$xcode_path" ]] then - if [[ -z "$HOMEBREW_MACOS_VERSION" ]] - then - HOMEBREW_MACOS_VERSION="$(/usr/bin/sw_vers -productVersion)" - fi - printf -v macos_version_numeric "%02d%02d%02d" ${HOMEBREW_MACOS_VERSION//./ } - if [[ "$macos_version_numeric" -ge "100900" ]] + if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -ge "100900" ]] then popup_stub=1 fi diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc index 0ea2f6e4e9..bbab4c448c 100755 --- a/Library/Homebrew/shims/super/cc +++ b/Library/Homebrew/shims/super/cc @@ -18,7 +18,7 @@ def mac? end def high_sierra_or_later? - mac? && RUBY_PLATFORM[/darwin\d+/][/\d+/].to_i >= 17 + mac? && ENV["HOMEBREW_MACOS_VERSION_NUMERIC"].to_s.to_i >= 101300 end def linux?