1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/distruby.rb
shyouhei e38fd64fcd * mkconfig.rb (RbConfig): add CONFIG['PATCHLEVEL']
* common.mk: new target dist

* distruby.rb: new file



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-27 15:12:18 +00:00

49 lines
1.1 KiB
Ruby
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!./miniruby
if RUBY_PATCHLEVEL.zero?
dirname = sprintf 'ruby-%s', RUBY_VERSION
tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)/, 'v\1_\2_\3'
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'
repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
STDERR.puts 'exporting sources...'
system 'svn', 'export', '-q', repos, dirname
Dir.chdir dirname do
STDERR.puts 'generating configure...'
system 'autoconf'
system 'rm', '-rf', 'autom4te.cache'
STDERR.puts 'generating parse.c...'
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
end
#
# Local Variables:
# mode: ruby
# code: utf-8
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# fill-column: 79
# default-justification: full
# End:
# vi: ts=3 sw=3