summaryrefslogtreecommitdiffstats
path: root/distruby.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-28 13:23:42 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-28 13:23:42 +0000
commitdcbc5ce0735e339713311431b6fca2592b603641 (patch)
tree92cf3f9b3a59e052b3891535e142f83cbef34784 /distruby.rb
parent7d8b85dede6236911a73686b11d1c31f30975a8e (diff)
downloadruby-dcbc5ce0735e339713311431b6fca2592b603641.tar.gz
ruby-dcbc5ce0735e339713311431b6fca2592b603641.tar.xz
ruby-dcbc5ce0735e339713311431b6fca2592b603641.zip
Merge changes between r11913 and r11943 from ruby_1_8.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@11944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'distruby.rb')
-rw-r--r--distruby.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/distruby.rb b/distruby.rb
new file mode 100644
index 000000000..dcc3e76ce
--- /dev/null
+++ b/distruby.rb
@@ -0,0 +1,49 @@
+#!./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
+