Merge pull request #5100 from MikeMcQuaid/or-later-default
bottles: make `or_later` the default.
This commit is contained in:
commit
9bcb1d5b01
@ -26,7 +26,9 @@ module Utils
|
|||||||
alias generic_find_matching_tag find_matching_tag
|
alias generic_find_matching_tag find_matching_tag
|
||||||
|
|
||||||
def find_matching_tag(tag)
|
def find_matching_tag(tag)
|
||||||
generic_find_matching_tag(tag) || find_altivec_tag(tag) || find_or_later_tag(tag)
|
generic_find_matching_tag(tag) ||
|
||||||
|
find_altivec_tag(tag) ||
|
||||||
|
find_older_compatible_tag(tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
# This allows generic Altivec PPC bottles to be supported in some
|
# This allows generic Altivec PPC bottles to be supported in some
|
||||||
@ -40,9 +42,8 @@ module Utils
|
|||||||
altivec_tag if key?(altivec_tag)
|
altivec_tag if key?(altivec_tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Allows a bottle tag to specify a specific OS or later,
|
# Find a bottle built for a previous version of macOS.
|
||||||
# so the same bottle can target multiple OSs.
|
def find_older_compatible_tag(tag)
|
||||||
def find_or_later_tag(tag)
|
|
||||||
begin
|
begin
|
||||||
tag_version = MacOS::Version.from_symbol(tag)
|
tag_version = MacOS::Version.from_symbol(tag)
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
@ -50,26 +51,14 @@ module Utils
|
|||||||
end
|
end
|
||||||
|
|
||||||
keys.find do |key|
|
keys.find do |key|
|
||||||
if key.to_s.end_with?("_or_later")
|
# TODO: move to compat?
|
||||||
later_tag = key.to_s[/(\w+)_or_later$/, 1].to_sym
|
key_tag_version = if key.to_s.end_with?("_or_later")
|
||||||
MacOS::Version.from_symbol(later_tag) <= tag_version
|
key.to_s[/(\w+)_or_later$/, 1].to_sym
|
||||||
elsif ARGV.force_bottle?
|
else
|
||||||
true
|
key
|
||||||
# Allow prerelease versions to act as if all bottles are `_or_later`
|
end
|
||||||
# so that they don't need to wait for us to bottle everything for the
|
MacOS::Version.from_symbol(key_tag_version) <= tag_version
|
||||||
# new release.
|
|
||||||
elsif install_older_prerelease_bottles?
|
|
||||||
true
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def install_older_prerelease_bottles?
|
|
||||||
return false unless OS::Mac.prerelease?
|
|
||||||
return true if ENV["HOMEBREW_INSTALL_OLDER_PRERELEASE_BOTTLES"]
|
|
||||||
return false if ENV["HOMEBREW_NO_INSTALL_OLDER_PRERELEASE_BOTTLES"]
|
|
||||||
|
|
||||||
!ARGV.homebrew_developer?
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user