Skip to content
Newer
Older
100644 50 lines (40 sloc) 1.13 KB
b224e16 @shyouhei * merge -c 11918
shyouhei authored
1 #!./miniruby
2
3 if RUBY_PATCHLEVEL.zero?
4 dirname = sprintf 'ruby-%s', RUBY_VERSION
5 tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)/, 'v\1_\2_\3'
6 else
7 dirname = sprintf 'ruby-%s-p%u', RUBY_VERSION, RUBY_PATCHLEVEL
8 tagname = dirname.gsub /ruby-(\d)\.(\d)\.(\d)-p/, 'v\1_\2_\3_'
9 end
10 tarname = dirname + '.tar.gz'
11 repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
12
13 STDERR.puts 'exporting sources...'
14 system 'svn', 'export', '-q', repos, dirname
15 Dir.chdir dirname do
16 STDERR.puts 'generating configure...'
17 system 'autoconf'
18 system 'rm', '-rf', 'autom4te.cache'
19
20 STDERR.puts 'generating parse.c...'
21 system 'bison', '-y', '-o', 'parse.c', 'parse.y'
22 end
23
24 STDERR.puts 'generating tarball...'
25 system 'tar', 'chofzp', tarname, dirname
26
27 open tarname, 'rb' do |fp|
28 require 'digest/md5'
29 require 'digest/sha1'
30 str = fp.read
31 md5 = Digest::MD5.hexdigest str
32 sha = Digest::SHA1.hexdigest str
33 printf "MD5(%s)= %s\nSHA1(%s)= %s\n", tarname, md5, tarname, sha
34 end
35
36
37
38 #
39 # Local Variables:
40 # mode: ruby
41 # code: utf-8
42 # indent-tabs-mode: t
43 # tab-width: 3
44 # ruby-indent-level: 3
45 # fill-column: 79
46 # default-justification: full
47 # End:
48 # vi: ts=3 sw=3
49
Something went wrong with that request. Please try again.