From 25249f0114a8792de803699c704c7e9e9652f934 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 20 Sep 2018 13:49:10 +0100 Subject: [PATCH] shims/super/cc: detect High Sierra differently. Don't rely on `RUBY_PLATFORM`'s kernel version as it's the machine that Ruby was built on (10.5) for portable ruby. --- Library/Homebrew/brew.sh | 1 + Library/Homebrew/shims/scm/git | 7 +------ Library/Homebrew/shims/super/cc | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) 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?