aboutsummaryrefslogtreecommitdiffstats
path: root/Library
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
parent9c5427d9a9a0cccc056d762ec9e8280d52c40237 (diff)
downloadbrew-8c9f0120cae52d60704e83f61b278b009b897422.tar.bz2
Formula#system: print dot for travis
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/test-bot.rb8
-rw-r--r--Library/Homebrew/formula.rb22
2 files changed, 25 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 04410b187..3f3e9ae52 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -530,7 +530,7 @@ module Homebrew
formula_fetch_options << canonical_formula_name
test "brew", "fetch", "--retry", *formula_fetch_options
test "brew", "uninstall", "--force", canonical_formula_name if formula.installed?
- install_args = []
+ install_args = ["--verbose"]
install_args << "--build-bottle" unless ARGV.include? "--no-bottle"
install_args << "--HEAD" if ARGV.include? "--HEAD"
@@ -848,7 +848,11 @@ module Homebrew
ENV["HOMEBREW_SANDBOX"] = "1"
ENV["HOMEBREW_NO_EMOJI"] = "1"
ENV["HOMEBREW_FAIL_LOG_LINES"] = "150"
- ARGV << "--verbose" if ENV["TRAVIS"]
+
+ if ENV["TRAVIS"]
+ ARGV << "--verbose"
+ ENV["HOMEBREW_VERBOSE_USING_DOTS"] = "1"
+ end
if ARGV.include?("--ci-master") || ARGV.include?("--ci-pr") \
|| ARGV.include?("--ci-testing")
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