Make verbose an installer mode

This commit is contained in:
Jack Nagel 2014-03-13 10:11:00 -05:00
parent 908d2ba792
commit 4d02849d43
4 changed files with 11 additions and 5 deletions

View File

@ -112,6 +112,8 @@ module Homebrew extend self
fi.force_bottle = ARGV.force_bottle?
fi.interactive = ARGV.interactive?
fi.interactive &&= :git if ARGV.flag? "--git"
fi.verbose = ARGV.verbose?
fi.verbose &&= :quieter if ARGV.quieter?
fi.prelude
fi.install
fi.caveats

View File

@ -59,6 +59,8 @@ module Homebrew extend self
installer = FormulaInstaller.new(f)
installer.options |= Tab.for_formula(f).used_options
installer.build_from_source = ARGV.build_from_source?
installer.verbose = ARGV.verbose?
installer.verbose &&= :quieter if ARGV.quieter?
installer.prelude
oh1 "Upgrading #{f.name}"

View File

@ -187,7 +187,6 @@ module HomebrewArgvExtension
--devel
--HEAD
]
flags_to_clear.concat %w[--verbose -v] if quieter?
flags_to_clear.each {|flag| delete flag}
yield

View File

@ -25,6 +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
def initialize ff
@f = ff
@ -35,6 +36,7 @@ class FormulaInstaller
@build_bottle = false
@force_bottle = false
@interactive = false
@verbose = false
@options = Options.new
@@attempted ||= Set.new
@ -343,6 +345,7 @@ class FormulaInstaller
fi.options |= inherited_options
fi.ignore_deps = true
fi.build_from_source = build_from_source?
fi.verbose = verbose? unless verbose == :quieter
fi.prelude
oh1 "Installing #{f} dependency: #{Tty.green}#{dep.name}#{Tty.reset}"
outdated_keg.unlink if outdated_keg
@ -376,7 +379,7 @@ class FormulaInstaller
def finish
return if only_deps?
ohai 'Finishing up' if ARGV.verbose?
ohai 'Finishing up' if verbose?
install_plist
@ -395,7 +398,7 @@ class FormulaInstaller
post_install
ohai "Summary" if ARGV.verbose? or show_summary_heading?
ohai "Summary" if verbose? or show_summary_heading?
puts summary
ensure
unlock if hold_locks?
@ -431,7 +434,7 @@ class FormulaInstaller
args << "--git" if interactive == :git
end
args << "--verbose" if ARGV.verbose?
args << "--verbose" if verbose?
args << "--debug" if ARGV.debug?
args << "--cc=#{ARGV.cc}" if ARGV.cc
args << "--env=#{ARGV.env}" if ARGV.env
@ -557,7 +560,7 @@ class FormulaInstaller
end
def clean
ohai "Cleaning" if ARGV.verbose?
ohai "Cleaning" if verbose?
Cleaner.new(f).clean
rescue Exception => e
opoo "The cleaning step did not complete successfully"