2020-10-10 14:16:11 +02:00
|
|
|
# typed: true
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-05 23:19:18 -04:00
|
|
|
module Homebrew
|
2020-08-17 04:53:36 +02:00
|
|
|
# @api private
|
2018-06-05 23:19:18 -04:00
|
|
|
module Fetch
|
2020-11-29 22:36:54 +01:00
|
|
|
extend T::Sig
|
|
|
|
|
|
|
|
sig { params(f: Formula, args: CLI::Args).returns(T::Boolean) }
|
2020-07-26 22:00:38 +02:00
|
|
|
def fetch_bottle?(f, args:)
|
2020-11-29 22:36:54 +01:00
|
|
|
bottle = f.bottle
|
|
|
|
|
|
|
|
return true if args.force_bottle? && bottle
|
|
|
|
return false unless bottle && f.pour_bottle?
|
2020-07-28 14:08:40 +02:00
|
|
|
return false if args.build_from_source_formulae.include?(f.full_name)
|
2020-11-29 22:36:54 +01:00
|
|
|
return false unless bottle.compatible_cellar?
|
2018-09-17 02:45:00 +02:00
|
|
|
|
2018-06-05 23:19:18 -04:00
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|