diff options
| author | Jack Nagel | 2014-09-05 15:13:53 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-09-05 15:13:53 -0500 |
| commit | 080a71e7fd8f936cede0abf3401a6b2c121b87cb (patch) | |
| tree | 3b5f2d229696ca55e8ae9c57b06cc166f13576cf /Library/Homebrew | |
| parent | a8981400d2ffffc6bd3089329641e31e7168c466 (diff) | |
| download | homebrew-080a71e7fd8f936cede0abf3401a6b2c121b87cb.tar.bz2 | |
Cache result of ARGV.verbose? on the stack
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index b65d56dd7..071cfb07b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -493,10 +493,11 @@ class Formula # Pretty titles the command and buffers stdout/stderr # Throws if there's an error def system cmd, *args + verbose = ARGV.verbose? # remove "boring" arguments so that the important ones are more likely to # be shown considering that we trim long ohai lines to the terminal width pretty_args = args.dup - if cmd == "./configure" and not ARGV.verbose? + if cmd == "./configure" and not verbose pretty_args.delete "--disable-dependency-tracking" pretty_args.delete "--disable-debug" end @@ -511,7 +512,7 @@ class Formula log = File.open(logfn, "w") log.puts Time.now, "", cmd, args, "" - if ARGV.verbose? + if verbose rd, wr = IO.pipe begin pid = fork do @@ -538,7 +539,7 @@ class Formula unless $?.success? log.flush - Kernel.system "/usr/bin/tail", "-n", "5", logfn unless ARGV.verbose? + Kernel.system "/usr/bin/tail", "-n", "5", logfn unless verbose log.puts require 'cmd/config' Homebrew.dump_build_config(log) |
