Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* distruby.rb: Add zip generation.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@12109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 2cad445d12cebb92b79967cbd74bdb9289b20e67 1 parent 51fc0c4
@shyouhei shyouhei authored
Showing with 25 additions and 11 deletions.
  1. +4 −0 ChangeLog
  2. +21 −11 distruby.rb
View
4 ChangeLog
@@ -1,3 +1,7 @@
+Tue Mar 20 15:37:24 2007 URABE Shyouhei <shyouhei@ruby-lang.org>
+
+ * distruby.rb: Add zip generation.
+
Tue Mar 20 11:28:41 2007 Akinori MUSHA <knu@iDaemons.org>
* lib/matrix.rb (Matrix::inverse_from): adding partial pivoting to
View
32 distruby.rb
@@ -7,7 +7,9 @@
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 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.