Improve superenv add/remove message.

* Now it includes all flags that are added or removed by superenv when
  passing "--verbose" or envvar VERBOSE or HOMEBREW_VERBOSE is set.
This commit is contained in:
Xiyue Deng 2013-10-12 05:23:06 -07:00
parent f2738dbe96
commit 3b66a7d4fd
2 changed files with 8 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class Cmd
else else
args << "-syslibroot" << $sdkroot args << "-syslibroot" << $sdkroot
end if nclt? end if nclt?
case mode allflags = case mode
when :ccld when :ccld
cflags + args + cppflags + ldflags cflags + args + cppflags + ldflags
when :cc when :cc
@ -98,6 +98,8 @@ class Cmd
when :ld when :ld
ldflags + args ldflags + args
end.compact end.compact
make_fuss(allflags) if verbose?
allflags
end end
def refurbished_args def refurbished_args
lset = Set.new(libpath + syslibpath) lset = Set.new(libpath + syslibpath)
@ -148,7 +150,6 @@ class Cmd
args << arg args << arg
end end
end end
make_fuss(args)
args args
end end
def cflags def cflags
@ -220,6 +221,9 @@ class Cmd
STDERR.puts "brew: superenv deduped: #{dups}" unless dups.empty? STDERR.puts "brew: superenv deduped: #{dups}" unless dups.empty?
STDERR.puts "brew: superenv added: #{adds*' '}" unless adds.empty? STDERR.puts "brew: superenv added: #{adds*' '}" unless adds.empty?
end end
def verbose?
!ENV['VERBOSE'].nil? || !ENV['HOMEBREW_VERBOSE'].nil?
end
end end
if __FILE__ == $PROGRAM_NAME if __FILE__ == $PROGRAM_NAME

View File

@ -58,6 +58,8 @@ end
begin begin
trap("INT", std_trap) # restore default CTRL-C handler trap("INT", std_trap) # restore default CTRL-C handler
ENV['HOMEBREW_VERBOSE'] = "1" if ARGV.verbose?
aliases = {'ls' => 'list', aliases = {'ls' => 'list',
'homepage' => 'home', 'homepage' => 'home',
'-S' => 'search', '-S' => 'search',