Merge pull request #5173 from MikeMcQuaid/handle-linux-bottles
os/mac/utils/bottles: handle Linux bottles.
This commit is contained in:
commit
f1080d96cd
@ -1,3 +1,4 @@
|
||||
require "compat/extend/os/mac/utils/bottles"
|
||||
require "compat/requirements/x11_requirement"
|
||||
require "compat/requirements/xcode_requirement"
|
||||
require "compat/cask"
|
||||
|
||||
19
Library/Homebrew/compat/extend/os/mac/utils/bottles.rb
Normal file
19
Library/Homebrew/compat/extend/os/mac/utils/bottles.rb
Normal file
@ -0,0 +1,19 @@
|
||||
module Utils
|
||||
class Bottles
|
||||
class Collector
|
||||
module Compat
|
||||
private
|
||||
|
||||
def tag_without_or_later(tag)
|
||||
return super unless tag.to_s.end_with?("_or_later")
|
||||
|
||||
odeprecated "`or_later` bottles",
|
||||
"bottles without `or_later` (or_later is implied now)"
|
||||
tag.to_s[/(\w+)_or_later$/, 1].to_sym
|
||||
end
|
||||
end
|
||||
|
||||
prepend Compat
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -42,6 +42,10 @@ module Utils
|
||||
altivec_tag if key?(altivec_tag)
|
||||
end
|
||||
|
||||
def tag_without_or_later(tag)
|
||||
tag
|
||||
end
|
||||
|
||||
# Find a bottle built for a previous version of macOS.
|
||||
def find_older_compatible_tag(tag)
|
||||
begin
|
||||
@ -51,13 +55,12 @@ module Utils
|
||||
end
|
||||
|
||||
keys.find do |key|
|
||||
# TODO: move to compat?
|
||||
key_tag_version = if key.to_s.end_with?("_or_later")
|
||||
key.to_s[/(\w+)_or_later$/, 1].to_sym
|
||||
else
|
||||
key
|
||||
key_tag_version = tag_without_or_later(key)
|
||||
begin
|
||||
MacOS::Version.from_symbol(key_tag_version) <= tag_version
|
||||
rescue ArgumentError
|
||||
false
|
||||
end
|
||||
MacOS::Version.from_symbol(key_tag_version) <= tag_version
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user