Fix tests on generic OS.

This commit is contained in:
Markus Reiter 2023-05-05 07:34:19 +02:00
parent 486c3765ce
commit a97e63efbf
No known key found for this signature in database
GPG Key ID: 245293B51702655B
2 changed files with 8 additions and 3 deletions

View File

@ -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)

View File

@ -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