summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-20 07:37:34 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-20 07:37:34 +0000
commit3a2d6ccff498d5296a671ce52937dcc0e2149fc9 (patch)
tree4fa19b1f0d3569abd547530676ed9fbf865aec20
parent9cbc8abb7fe097b43feff64a42856521f6b418bc (diff)
* distruby.rb: Add zip generation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@12109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--distruby.rb32
2 files changed, 25 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 37775255351..3b3a4dfea7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Mar 20 15:37:24 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * distruby.rb: Add zip generation.
+
Fri Mar 16 21:48:11 2007 Akinori MUSHA <knu@iDaemons.org>
* ext/dl/dl.c (rb_ary2cary): Fix a bug in type validation;
diff --git a/distruby.rb b/distruby.rb
index dcc3e76ce8c..613da0eb9cb 100644
--- a/distruby.rb
+++ b/distruby.rb
@@ -7,7 +7,9 @@ else
dirname = sprintf 'ruby-%s-p%u', RUBY_VERSION, RUBY_PATCHLEVEL
tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)-p/, 'v\1_\2_\3_'
end
-tarname = dirname + '.tar.gz'
+tgzname = dirname + '.tar.gz'
+tbzname = dirname + '.tar.bz2'
+zipname = dirname + '.zip'
repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
STDERR.puts 'exporting sources...'
@@ -21,16 +23,24 @@ Dir.chdir dirname do
system 'bison', '-y', '-o', 'parse.c', 'parse.y'
end
-STDERR.puts 'generating tarball...'
-system 'tar', 'chofzp', tarname, dirname
-
-open tarname, 'rb' do |fp|
- require 'digest/md5'
- require 'digest/sha1'
- str = fp.read
- md5 = Digest::MD5.hexdigest str
- sha = Digest::SHA1.hexdigest str
- printf "MD5(%s)= %s\nSHA1(%s)= %s\n", tarname, md5, tarname, sha
+STDERR.puts 'generating tarballs...'
+ENV['GZIP'] = '-9'
+system 'tar', 'chofzp', tgzname, dirname
+system 'tar', 'chojfp', tbzname, dirname
+system 'zip', '-q9r', zipname, dirname
+
+require 'digest/md5'
+require 'digest/sha2'
+for name in [tgzname, tbzname, zipname] do
+ open name, 'rb' do |fp|
+ str = fp.read
+ md5 = Digest::MD5.hexdigest str
+ sha = Digest::SHA256.hexdigest str
+ printf "MD5(%s)= %s\nSHA256(%s)= %s\nSIZE(%s)= %s\n\n",
+ name, md5,
+ name, sha,
+ name, str.size
+ end
end