brew/Library/Homebrew/fetch.rb

21 lines
564 B
Ruby
Raw Normal View History

2021-09-11 01:00:23 +01:00
# typed: strict
# frozen_string_literal: true
module Homebrew
2020-08-17 04:53:36 +02:00
# @api private
module Fetch
sig { params(formula: Formula, args: CLI::Args).returns(T::Boolean) }
def fetch_bottle?(formula, args:)
bottle = formula.bottle
2020-11-29 22:36:54 +01:00
return true if args.force_bottle? && bottle.present?
return true if args.bottle_tag.present? && formula.bottled?(args.bottle_tag)
2018-09-17 02:45:00 +02:00
bottle.present? &&
formula.pour_bottle? &&
args.build_from_source_formulae.exclude?(formula.full_name) &&
bottle.compatible_locations?
end
end
end