Merge pull request #12100 from Bo98/fi-fix-no-bottle
formula_installer: fix error if a compatible bottle was not found
This commit is contained in:
commit
91acec50f9
@ -63,7 +63,7 @@ module Homebrew
|
||||
sig { params(formula: Formula, args: CLI::Args).void }
|
||||
def print_formula_cache(formula, args:)
|
||||
if fetch_bottle?(formula, args: args)
|
||||
puts formula.bottle_for_tag(args.bottle_tag).cached_download
|
||||
puts formula.bottle_for_tag(args.bottle_tag&.to_sym).cached_download
|
||||
elsif args.HEAD?
|
||||
puts formula.head.cached_download
|
||||
else
|
||||
|
||||
@ -93,7 +93,7 @@ module Homebrew
|
||||
begin
|
||||
f.clear_cache if args.force?
|
||||
f.fetch_bottle_tab
|
||||
fetch_formula(f.bottle_for_tag(args.bottle_tag), args: args)
|
||||
fetch_formula(f.bottle_for_tag(args.bottle_tag&.to_sym), args: args)
|
||||
rescue Interrupt
|
||||
raise
|
||||
rescue => e
|
||||
|
||||
@ -371,7 +371,7 @@ class Formula
|
||||
|
||||
# The Bottle object for given tag.
|
||||
# @private
|
||||
sig { params(tag: T.nilable(String)).returns(T.nilable(Bottle)) }
|
||||
sig { params(tag: T.nilable(Symbol)).returns(T.nilable(Bottle)) }
|
||||
def bottle_for_tag(tag = nil)
|
||||
Bottle.new(self, bottle_specification, tag) if bottled?(tag)
|
||||
end
|
||||
|
||||
@ -150,8 +150,10 @@ class FormulaInstaller
|
||||
return false
|
||||
end
|
||||
|
||||
bottle = formula.bottle
|
||||
if bottle && !bottle.compatible_locations?
|
||||
bottle = formula.bottle_for_tag(Utils::Bottles.tag.to_sym)
|
||||
return false if bottle.nil?
|
||||
|
||||
unless bottle.compatible_locations?
|
||||
if output_warning
|
||||
prefix = Pathname(bottle.cellar).parent
|
||||
opoo <<~EOS
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user