From 1292c4559cce781b000197e47cae10e9afb8523e Mon Sep 17 00:00:00 2001 From: Gautham G Date: Sat, 14 Mar 2020 19:49:15 +0530 Subject: [PATCH] ARGV: Deprecate ARGV.interactive? --- Library/Homebrew/build.rb | 2 +- Library/Homebrew/extend/ARGV.rb | 4 ---- Library/Homebrew/formula.rb | 4 ++-- Library/Homebrew/formula_installer.rb | 2 +- Library/Homebrew/reinstall.rb | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index d7e576db89..5d1fc4dad1 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -126,7 +126,7 @@ class Build system "git", "init" system "git", "add", "-A" end - if ARGV.interactive? + if Homebrew.args.interactive? ohai "Entering interactive mode" puts "Type `exit` to return and finalize the installation." puts "Install to this prefix: #{formula.prefix}" diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index dfb0045f4a..dab3ccfa8b 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 interactive? - flag? "--interactive" - end - def keep_tmp? include? "--keep-tmp" end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 48abb74447..155287635f 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1132,7 +1132,7 @@ class Formula begin yield self, staging rescue - staging.retain! if ARGV.interactive? || ARGV.debug? + staging.retain! if Homebrew.args.interactive? || ARGV.debug? raise ensure cp Dir["config.log", "CMakeCache.txt"], logs @@ -2084,7 +2084,7 @@ class Formula HOMEBREW_PATH: nil, } - unless ARGV.interactive? + unless Homebrew.args.interactive? stage_env[:HOME] = env_home stage_env[:_JAVA_OPTIONS] = "#{ENV["_JAVA_OPTIONS"]&.+(" ")}-Duser.home=#{HOMEBREW_CACHE}/java_cache" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index d7fba9fd98..5bcea96088 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -752,7 +752,7 @@ class FormulaInstaller sandbox = Sandbox.new formula.logs.mkpath sandbox.record_log(formula.logs/"build.sandbox.log") - sandbox.allow_write_path(ENV["HOME"]) if ARGV.interactive? + sandbox.allow_write_path(ENV["HOME"]) if Homebrew.args.interactive? sandbox.allow_write_temp_and_cache sandbox.allow_write_log(formula) sandbox.allow_cvs diff --git a/Library/Homebrew/reinstall.rb b/Library/Homebrew/reinstall.rb index 146d3170ef..bbc41a7fa5 100644 --- a/Library/Homebrew/reinstall.rb +++ b/Library/Homebrew/reinstall.rb @@ -26,7 +26,7 @@ module Homebrew fi = FormulaInstaller.new(f) fi.options = options fi.build_bottle = ARGV.build_bottle? - fi.interactive = ARGV.interactive? + fi.interactive = Homebrew.args.interactive? fi.git = ARGV.git? fi.link_keg ||= keg_was_linked if keg_had_linked_opt fi.build_from_source = true if build_from_source