From 07b19cba09ec39a4c879718f96bad308541ed10e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 10 May 2020 15:15:41 +0100 Subject: [PATCH] Replace ARGV#bottle_arch with Homebrew.args.bottle_arch Part of https://github.com/Homebrew/brew/issues/5730 --- Library/Homebrew/extend/ARGV.rb | 5 ----- Library/Homebrew/extend/ENV/shared.rb | 4 ++-- Library/Homebrew/extend/os/linux/extend/ENV/shared.rb | 2 +- Library/Homebrew/formula_installer.rb | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 27f21a228f..67ca1b264c 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -15,11 +15,6 @@ module HomebrewArgvExtension flag?("--debug") || !ENV["HOMEBREW_DEBUG"].nil? end - def bottle_arch - arch = value "bottle-arch" - arch&.to_sym - end - def cc value "cc" end diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index fc422fa352..cfc48b2b82 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -268,8 +268,8 @@ module SharedEnvExtension # @private def effective_arch - if Homebrew.args.build_bottle? && ARGV.bottle_arch - ARGV.bottle_arch + if Homebrew.args.build_bottle? && Homebrew.args.bottle_arch + Homebrew.args.bottle_arch else Hardware.oldest_cpu end diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb index cd48e4f366..0ebba4f6bc 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb @@ -4,7 +4,7 @@ module SharedEnvExtension # @private def effective_arch if Homebrew.args.build_bottle? - ARGV.bottle_arch || Hardware.oldest_cpu + Homebrew.args.bottle_arch || Hardware.oldest_cpu else :native end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index cd757386cb..e7ba8847bd 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -267,7 +267,7 @@ class FormulaInstaller return if only_deps? - if build_bottle? && (arch = ARGV.bottle_arch) && !Hardware::CPU.optimization_flags.include?(arch) + if build_bottle? && (arch = Homebrew.args.bottle_arch) && !Hardware::CPU.optimization_flags.include?(arch) raise "Unrecognized architecture for --bottle-arch: #{arch}" end @@ -699,7 +699,7 @@ class FormulaInstaller if build_bottle? args << "--build-bottle" - args << "--bottle-arch=#{ARGV.bottle_arch}" if ARGV.bottle_arch + args << "--bottle-arch=#{Homebrew.args.bottle_arch}" if Homebrew.args.bottle_arch end args << "--git" if git?