Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 60 lines (50 sloc) 1.405 kb
511dc44 initial import
Laurent Sansonetti 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 tgzname = dirname + '.tar.gz'
11 tbzname = dirname + '.tar.bz2'
12 zipname = dirname + '.zip'
13 repos = 'http://svn.ruby-lang.org/repos/ruby/tags/' + tagname
14
15 STDERR.puts 'exporting sources...'
16 system 'svn', 'export', '-q', repos, dirname
17 Dir.chdir dirname do
18 STDERR.puts 'generating configure...'
19 system 'autoconf'
20 system 'rm', '-rf', 'autom4te.cache'
21
22 STDERR.puts 'generating parse.c...'
23 system 'bison', '-y', '-o', 'parse.c', 'parse.y'
24 end
25
26 STDERR.puts 'generating tarballs...'
27 ENV['GZIP'] = '-9'
28 system 'tar', 'chofzp', tgzname, dirname
29 system 'tar', 'chojfp', tbzname, dirname
30 system 'zip', '-q9r', zipname, dirname
31
32 require 'digest/md5'
33 require 'digest/sha2'
34 for name in [tgzname, tbzname, zipname] do
35 open name, 'rb' do |fp|
36 str = fp.read
37 md5 = Digest::MD5.hexdigest str
38 sha = Digest::SHA256.hexdigest str
39 printf "MD5(%s)= %s\nSHA256(%s)= %s\nSIZE(%s)= %s\n\n",
40 name, md5,
41 name, sha,
42 name, str.size
43 end
44 end
45
46
47
48 #
49 # Local Variables:
50 # mode: ruby
51 # code: utf-8
52 # indent-tabs-mode: t
53 # tab-width: 3
54 # ruby-indent-level: 3
55 # fill-column: 79
56 # default-justification: full
57 # End:
58 # vi: ts=3 sw=3
59
Something went wrong with that request. Please try again.