aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorXu Cheng2015-09-23 15:40:27 +0800
committerXu Cheng2015-09-23 21:46:44 +0800
commit8c9f0120cae52d60704e83f61b278b009b897422 (patch)
treea544e555419c4bd711d23c019926187849371c76 /Library/Homebrew/formula.rb
parent9c5427d9a9a0cccc056d762ec9e8280d52c40237 (diff)
downloadbrew-8c9f0120cae52d60704e83f61b278b009b897422.tar.bz2
Formula#system: print dot for travis
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 3e7e24d43..ef76eb023 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -1255,6 +1255,8 @@ class Formula
# system "make", "install"</pre>
def system(cmd, *args)
verbose = ARGV.verbose?
+ verbose_using_dots = !ENV["HOMEBREW_VERBOSE_USING_DOTS"].nil?
+
# 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
@@ -1288,9 +1290,23 @@ class Formula
end
wr.close
- while buf = rd.gets
- log.puts buf
- puts buf
+ if verbose_using_dots
+ last_dot = Time.at(0)
+ while buf = rd.gets
+ log.puts buf
+ # make sure dots printed with interval of at least 1 min.
+ if (Time.now - last_dot) > 60
+ print "."
+ $stdout.flush
+ last_dot = Time.now
+ end
+ end
+ puts
+ else
+ while buf = rd.gets
+ log.puts buf
+ puts buf
+ end
end
ensure
rd.close