diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index c2f02d431697a..64eb881fd92e2 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -87,6 +87,7 @@ then odie "Cowardly refusing to continue at this prefix: $HOMEBREW_PREFIX" fi +HOMEBREW_PROCESSOR="$(uname -m)" HOMEBREW_SYSTEM="$(uname -s)" case "$HOMEBREW_SYSTEM" in Darwin) HOMEBREW_MACOS="1" ;; @@ -119,11 +120,9 @@ fi if [[ -n "$HOMEBREW_MACOS" ]] then - HOMEBREW_PROCESSOR="$(uname -p)" HOMEBREW_PRODUCT="Homebrew" HOMEBREW_SYSTEM="Macintosh" - # This is i386 even on x86_64 machines - [[ "$HOMEBREW_PROCESSOR" = "i386" ]] && HOMEBREW_PROCESSOR="Intel" + [[ "$HOMEBREW_PROCESSOR" = "x86_64" ]] && HOMEBREW_PROCESSOR="Intel" HOMEBREW_MACOS_VERSION="$(/usr/bin/sw_vers -productVersion)" HOMEBREW_OS_VERSION="macOS $HOMEBREW_MACOS_VERSION" # Don't change this from Mac OS X to match what macOS itself does in Safari on 10.12 @@ -166,7 +165,6 @@ then HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH="1" fi else - HOMEBREW_PROCESSOR="$(uname -m)" HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew" [[ -n "$HOMEBREW_LINUX" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)" : "${HOMEBREW_OS_VERSION:=$(uname -r)}" diff --git a/Library/Homebrew/extend/os/mac/utils/bottles.rb b/Library/Homebrew/extend/os/mac/utils/bottles.rb index 99a22c3513777..4b938678872db 100644 --- a/Library/Homebrew/extend/os/mac/utils/bottles.rb +++ b/Library/Homebrew/extend/os/mac/utils/bottles.rb @@ -6,9 +6,11 @@ class << self undef tag def tag - tag = MacOS.version.to_sym - tag = "#{tag}_arm".to_sym if Hardware::CPU.arm? - tag + if Hardware::CPU.intel? + MacOS.version.to_sym + else + "#{Hardware::CPU.arch}_#{MacOS.version.to_sym}".to_sym + end end end