From 3b66a7d4fd41947f8c2a472a0dfe7afa840c93cf Mon Sep 17 00:00:00 2001 From: Xiyue Deng Date: Sat, 12 Oct 2013 05:23:06 -0700 Subject: [PATCH] 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. --- Library/ENV/4.3/cc | 8 ++++++-- Library/brew.rb | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 8075017d8e..bef8b8c41d 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -86,7 +86,7 @@ class Cmd else args << "-syslibroot" << $sdkroot end if nclt? - case mode + allflags = case mode when :ccld cflags + args + cppflags + ldflags when :cc @@ -98,6 +98,8 @@ class Cmd when :ld ldflags + args end.compact + make_fuss(allflags) if verbose? + allflags end def refurbished_args lset = Set.new(libpath + syslibpath) @@ -148,7 +150,6 @@ class Cmd args << arg end end - make_fuss(args) args end def cflags @@ -220,6 +221,9 @@ class Cmd STDERR.puts "brew: superenv deduped: #{dups}" unless dups.empty? STDERR.puts "brew: superenv added: #{adds*' '}" unless adds.empty? end + def verbose? + !ENV['VERBOSE'].nil? || !ENV['HOMEBREW_VERBOSE'].nil? + end end if __FILE__ == $PROGRAM_NAME diff --git a/Library/brew.rb b/Library/brew.rb index b72d61494f..f4bef15d85 100755 --- a/Library/brew.rb +++ b/Library/brew.rb @@ -58,6 +58,8 @@ end begin trap("INT", std_trap) # restore default CTRL-C handler + ENV['HOMEBREW_VERBOSE'] = "1" if ARGV.verbose? + aliases = {'ls' => 'list', 'homepage' => 'home', '-S' => 'search',