diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 16 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_ARGV.rb | 2 |
5 files changed, 12 insertions, 9 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 24a00972c..2b1c577f0 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -114,6 +114,7 @@ module Homebrew extend self fi.interactive &&= :git if ARGV.flag? "--git" fi.verbose = ARGV.verbose? fi.verbose &&= :quieter if ARGV.quieter? + fi.debug = ARGV.debug? fi.prelude fi.install fi.caveats diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 7138ea345..adcbf49b6 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -61,6 +61,7 @@ module Homebrew extend self installer.build_from_source = ARGV.build_from_source? installer.verbose = ARGV.verbose? installer.verbose &&= :quieter if ARGV.quieter? + installer.debug = ARGV.debug? installer.prelude oh1 "Upgrading #{f.name}" diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 78cc1c742..6703e2061 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -183,7 +183,6 @@ module HomebrewArgvExtension old_args = clone flags_to_clear = %w[ - --debug -d --devel --HEAD ] diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index bc05164d8..a08b188a1 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -25,7 +25,7 @@ class FormulaInstaller mode_attr_accessor :show_summary_heading, :show_header mode_attr_accessor :build_from_source, :build_bottle, :force_bottle mode_attr_accessor :ignore_deps, :only_deps, :interactive - mode_attr_accessor :verbose + mode_attr_accessor :verbose, :debug def initialize ff @f = ff @@ -37,6 +37,7 @@ class FormulaInstaller @force_bottle = false @interactive = false @verbose = false + @debug = false @options = Options.new @@attempted ||= Set.new @@ -199,7 +200,7 @@ class FormulaInstaller # HACK: If readline is present in the dependency tree, it will clash # with the stdlib's Readline module when the debugger is loaded def perform_readline_hack - if f.recursive_dependencies.any? { |d| d.name == "readline" } && ARGV.debug? + if f.recursive_dependencies.any? { |d| d.name == "readline" } && debug? ENV['HOMEBREW_NO_READLINE'] = '1' end end @@ -346,6 +347,7 @@ class FormulaInstaller fi.ignore_deps = true fi.build_from_source = build_from_source? fi.verbose = verbose? unless verbose == :quieter + fi.debug = debug? fi.prelude oh1 "Installing #{f} dependency: #{Tty.green}#{dep.name}#{Tty.reset}" outdated_keg.unlink if outdated_keg @@ -435,7 +437,7 @@ class FormulaInstaller end args << "--verbose" if verbose? - args << "--debug" if ARGV.debug? + args << "--debug" if debug? args << "--cc=#{ARGV.cc}" if ARGV.cc args << "--env=#{ARGV.env}" if ARGV.env args << "--HEAD" if ARGV.build_head? @@ -528,7 +530,7 @@ class FormulaInstaller puts "Possible conflicting files are:" mode = OpenStruct.new(:dry_run => true, :overwrite => true) keg.link(mode) - ohai e, e.backtrace if ARGV.debug? + ohai e, e.backtrace if debug? @show_summary_heading = true ignore_interrupts{ keg.unlink } raise unless e.kind_of? RuntimeError @@ -555,7 +557,7 @@ class FormulaInstaller onoe "Failed to fix install names" puts "The formula built, but you may encounter issues using it or linking other" puts "formula against it." - ohai e, e.backtrace if ARGV.debug? + ohai e, e.backtrace if debug? @show_summary_heading = true end @@ -565,7 +567,7 @@ class FormulaInstaller rescue Exception => e opoo "The cleaning step did not complete successfully" puts "Still, the installation was successful, so we will link it into your prefix" - ohai e, e.backtrace if ARGV.debug? + ohai e, e.backtrace if debug? @show_summary_heading = true end @@ -574,7 +576,7 @@ class FormulaInstaller rescue Exception => e opoo "The post-install step did not complete successfully" puts "You can try again using `brew postinstall #{f.name}`" - ohai e, e.backtrace if ARGV.debug? + ohai e, e.backtrace if debug? @show_summary_heading = true end diff --git a/Library/Homebrew/test/test_ARGV.rb b/Library/Homebrew/test/test_ARGV.rb index 838ce5281..2a29dadf7 100644 --- a/Library/Homebrew/test/test_ARGV.rb +++ b/Library/Homebrew/test/test_ARGV.rb @@ -49,7 +49,7 @@ class ArgvExtensionTests < Test::Unit::TestCase end def test_filter_for_dependencies_clears_flags - @argv << "--debug" + @argv << "--HEAD" << "--devel" @argv.filter_for_dependencies { assert @argv.empty? } end |
