summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-15 02:39:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-15 02:39:06 +0000
commitd25ed18c3defab09e71318baca5037541728c877 (patch)
tree01b98f339375c255bed445ebdab216287f004420 /tool/make-snapshot
parent95797e13d4a32d5ec3222f223b7d4a37d24a2452 (diff)
make-snapshot: colorize [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot32
1 files changed, 22 insertions, 10 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index affc412fb7..d628004dea 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -7,6 +7,7 @@ require 'fileutils'
require 'shellwords'
require 'tmpdir'
require File.expand_path("../vcs", __FILE__)
+require File.expand_path("../colorize", __FILE__)
STDOUT.sync = true
$srcdir ||= nil
@@ -18,6 +19,7 @@ $packages ||= nil
$digests ||= nil
$tooldir = File.expand_path("..", __FILE__)
$unicode_version = nil if ($unicode_version ||= nil) == ""
+$colorize = Colorize.new
def usage
<<USAGE
@@ -262,7 +264,17 @@ def package(vcs, rev, destdir, tmp = nil)
end
system(*%W"patch -d #{v} -p0 -i #{$patch_file}") if $patch_file
if !$exported or $patch_file
- "take a breath, and go ahead".scan(/./) {|c|print c; sleep(c == "," ? 0.7 : 0.05)}; puts
+ colors = %w[red yellow green cyan blue magenta]
+ "take a breath, and go ahead".scan(/./) do |c|
+ if c == ' '
+ print c
+ else
+ colors.push(color = colors.shift)
+ print $colorize.decorate(c, color)
+ end
+ sleep(c == "," ? 0.7 : 0.05)
+ end
+ puts
end
def (clean = []).add(n) push(n); n end
Dir.chdir(v) do
@@ -277,10 +289,10 @@ def package(vcs, rev, destdir, tmp = nil)
unless File.exist?("configure")
print "creating configure..."
unless system([ENV["AUTOCONF"]]*2)
- puts " failed"
+ puts $colorize.fail(" failed")
return
end
- puts " done"
+ puts $colorize.pass(" done")
end
clean.add("autom4te.cache")
clean.add("enc/unicode/data")
@@ -354,10 +366,10 @@ update-gems:
FileUtils.rm_rf("gems")
end
unless $?.success?
- puts " failed"
+ puts $colorize.fail(" failed")
return
end
- puts " done"
+ puts $colorize.pass(" done")
end
if v == "."
@@ -381,9 +393,9 @@ update-gems:
tarball = "#{$archname||v}.tar"
print "creating tarball... #{tarball}"
if system("tar", "cf", tarball, v)
- puts " done"
+ puts $colorize.pass(" done")
else
- puts " failed"
+ puts $colorize.fail(" failed")
tarball = ""
next
end
@@ -401,10 +413,10 @@ update-gems:
done = system(*cmd)
end
if done
- puts " done"
+ puts $colorize.pass(" done")
file
else
- puts " failed"
+ puts $colorize.fail(" failed")
nil
end
end.compact
@@ -432,7 +444,7 @@ revisions.collect {|rev| package(vcs, rev, destdir, tmp)}.flatten.each do |name|
next
end
str = open(name, "rb") {|f| f.read}
- puts "* #{name}"
+ puts "* #{$colorize.pass(name)}"
puts " SIZE: #{str.bytesize} bytes"
$digests.each do |alg|
printf " %-8s%s\n", "#{alg}:", Digest.const_get(alg).hexdigest(str)