diff --git a/Library/Homebrew/cli/args.rb b/Library/Homebrew/cli/args.rb index 2f2b90a125..a60d6b23e7 100644 --- a/Library/Homebrew/cli/args.rb +++ b/Library/Homebrew/cli/args.rb @@ -179,6 +179,12 @@ module Homebrew cmdline_args.include?("--build-from-source") || cmdline_args.include?("-s") end + def build_bottle + return true if args_parsed && build_bottle? + + cmdline_args.include?("--build-bottle") + end + def force_bottle return true if args_parsed && force_bottle? @@ -221,12 +227,6 @@ module Homebrew cmdline_args.include?("--universal") end - def build_bottle - return true if args_parsed && build_bottle? - - cmdline_args.include?("--build-bottle") - end - def spec(default = :stable) if head :head diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 2f4c3fd381..ddaa63f319 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -31,10 +31,6 @@ module HomebrewArgvExtension flag?("--debug") || !ENV["HOMEBREW_DEBUG"].nil? end - def build_bottle? - include?("--build-bottle") - end - def bottle_arch arch = value "bottle-arch" arch&.to_sym diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index acfeeb671c..0f6fda16e4 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -268,7 +268,7 @@ module SharedEnvExtension # @private def effective_arch - if ARGV.build_bottle? && ARGV.bottle_arch + if Homebrew.args.build_bottle && ARGV.bottle_arch ARGV.bottle_arch else Hardware.oldest_cpu diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb index 4b76a64afb..cd48e4f366 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb @@ -3,7 +3,7 @@ module SharedEnvExtension # @private def effective_arch - if ARGV.build_bottle? + if Homebrew.args.build_bottle? ARGV.bottle_arch || Hardware.oldest_cpu else :native diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index c96960d166..4a53a2a757 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -25,7 +25,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = options - fi.build_bottle = ARGV.build_bottle? + fi.build_bottle = Homebrew.args.build_bottle fi.interactive = Homebrew.args.interactive? fi.git = Homebrew.args.git? fi.link_keg ||= keg_was_linked if keg_had_linked_opt