Merge pull request #7434 from GauthamGoli/argv-cleanup-22

ARGV: Deprecate ARGV.build_bottle? and replace with Homebrew.args.build_bottle
This commit is contained in:
Mike McQuaid 2020-04-26 14:14:35 +01:00 committed by GitHub
commit bdc7ebf3c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 13 deletions

View File

@ -179,6 +179,12 @@ module Homebrew
cmdline_args.include?("--build-from-source") || cmdline_args.include?("-s") cmdline_args.include?("--build-from-source") || cmdline_args.include?("-s")
end end
def build_bottle
return true if args_parsed && build_bottle?
cmdline_args.include?("--build-bottle")
end
def force_bottle def force_bottle
return true if args_parsed && force_bottle? return true if args_parsed && force_bottle?
@ -221,12 +227,6 @@ module Homebrew
cmdline_args.include?("--universal") cmdline_args.include?("--universal")
end end
def build_bottle
return true if args_parsed && build_bottle?
cmdline_args.include?("--build-bottle")
end
def spec(default = :stable) def spec(default = :stable)
if head if head
:head :head

View File

@ -31,10 +31,6 @@ module HomebrewArgvExtension
flag?("--debug") || !ENV["HOMEBREW_DEBUG"].nil? flag?("--debug") || !ENV["HOMEBREW_DEBUG"].nil?
end end
def build_bottle?
include?("--build-bottle")
end
def bottle_arch def bottle_arch
arch = value "bottle-arch" arch = value "bottle-arch"
arch&.to_sym arch&.to_sym

View File

@ -268,7 +268,7 @@ module SharedEnvExtension
# @private # @private
def effective_arch def effective_arch
if ARGV.build_bottle? && ARGV.bottle_arch if Homebrew.args.build_bottle && ARGV.bottle_arch
ARGV.bottle_arch ARGV.bottle_arch
else else
Hardware.oldest_cpu Hardware.oldest_cpu

View File

@ -3,7 +3,7 @@
module SharedEnvExtension module SharedEnvExtension
# @private # @private
def effective_arch def effective_arch
if ARGV.build_bottle? if Homebrew.args.build_bottle?
ARGV.bottle_arch || Hardware.oldest_cpu ARGV.bottle_arch || Hardware.oldest_cpu
else else
:native :native

View File

@ -25,7 +25,7 @@ module Homebrew
fi = FormulaInstaller.new(f) fi = FormulaInstaller.new(f)
fi.options = options fi.options = options
fi.build_bottle = ARGV.build_bottle? fi.build_bottle = Homebrew.args.build_bottle
fi.interactive = Homebrew.args.interactive? fi.interactive = Homebrew.args.interactive?
fi.git = Homebrew.args.git? fi.git = Homebrew.args.git?
fi.link_keg ||= keg_was_linked if keg_had_linked_opt fi.link_keg ||= keg_was_linked if keg_had_linked_opt