diff --git a/Library/Homebrew/fetch.rb b/Library/Homebrew/fetch.rb index edb17c0e05..3aeaee8929 100644 --- a/Library/Homebrew/fetch.rb +++ b/Library/Homebrew/fetch.rb @@ -18,7 +18,12 @@ module Homebrew bottle = formula.bottle return true if force_bottle && bottle.present? - return true if os.present? + if os.present? + return true + elsif ENV["HOMEBREW_TEST_GENERIC_OS"].present? + # `:generic` bottles don't exist, and `--os` flag is not specified. + return false + end return true if arch.present? return true if bottle_tag.present? && formula.bottled?(bottle_tag) diff --git a/Library/Homebrew/simulate_system.rb b/Library/Homebrew/simulate_system.rb index 2b1b0faa01..e4f1a75088 100644 --- a/Library/Homebrew/simulate_system.rb +++ b/Library/Homebrew/simulate_system.rb @@ -23,8 +23,8 @@ module Homebrew old_arch = self.arch begin - self.os = os if os - self.arch = arch if arch + self.os = os if os && os != current_os + self.arch = arch if arch && arch != current_arch yield ensure