From a2ae77350301cbefc7879151abba8569fcc864f0 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 26 Sep 2008 09:40:04 +0000 Subject: * common.mk (dist): nothing is need to run BASERUBY. * tool/make-snapshot: new option -archname. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ common.mk | 2 +- tool/make-snapshot | 31 ++++++++++++++++++++++++------- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f6ed92c8e..df08d95eda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Sep 26 18:39:59 2008 Nobuyoshi Nakada + + * common.mk (dist): nothing is need to run BASERUBY. + + * tool/make-snapshot: new option -archname. + Fri Sep 26 18:24:28 2008 Nobuyoshi Nakada * misc/ruby-mode.el: safe custimizable variables. diff --git a/common.mk b/common.mk index db1fc5c10b..29cf4ce23a 100644 --- a/common.mk +++ b/common.mk @@ -715,7 +715,7 @@ run.gdb: gdb: miniruby$(EXEEXT) run.gdb PHONY gdb -x run.gdb --quiet --args $(MINIRUBY) $(srcdir)/test.rb -dist: $(PREP) +dist: $(BASERUBY) $(srcdir)/tool/make-snapshot . up: diff --git a/tool/make-snapshot b/tool/make-snapshot index f6529d9c25..7ad64bd55d 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -6,6 +6,9 @@ require 'fileutils' require 'tmpdir' STDOUT.sync = true +$exported = nil if $exported == "" +$archname = nil if $archname == "" + ENV["LC_ALL"] = ENV["LANG"] = "C" SVNURL = URI.parse("http://svn.ruby-lang.org/repos/ruby/") RUBY_VERSION_PATTERN = /^\#define\s+RUBY_VERSION\s+"([\d.]+)"/ @@ -22,7 +25,7 @@ path = ENV["PATH"].split(File::PATH_SEPARATOR) %w[YACC BASERUBY RUBY MV MINIRUBY].each do |var| cmd = ENV[var] unless path.any? {|dir| - file = File.join(dir, cmd) + file = File.expand_path(cmd, dir) File.file?(file) and File.executable?(file) } abort "#{File.basename $0}: #{var} command not found - #{cmd}" @@ -74,9 +77,15 @@ def package(rev, destdir) end revision = `svn info #{url}`[/Last Changed Rev: (\d+)/, 1] end - unless $exported + v = nil + if $exported + if String === $exported + v = $exported + end + else + v = "ruby" puts "Exporting #{rev}@#{revision}" - IO.popen("svn export #{url} ruby") do |pipe| + IO.popen("svn export #{url} #{v}") do |pipe| pipe.each {|line| /^A/ =~ line or print line} end unless $?.success? @@ -85,7 +94,7 @@ def package(rev, destdir) end end - if !File.directory?(v = "ruby") + if !File.directory?(v) v = Dir.glob("ruby-*").select(&File.method(:directory?)) v.size == 1 or abort "not exported" v = v[0] @@ -100,8 +109,11 @@ def package(rev, destdir) else tag ||= "r#{revision}" end - v = "ruby-#{version}-#{tag}" - File.directory?(v) or File.rename "ruby", v + unless v == $exported + n = "ruby-#{version}-#{tag}" + File.directory?(n) or File.rename v, n + v = n + end system("patch -d #{v} -p0 -i #{$patch_file}") if $patch_file def (clean = []).add(n) push(n); n end Dir.chdir(v) do @@ -154,11 +166,16 @@ def package(rev, destdir) puts " done" end + if v == "." + v = File.basename(Dir.pwd) + Dir.chdir ".." + end + return [["bzip tarball", ".tar.bz2", %w"tar cjf"], ["gzip tarball", ".tar.gz", %w"tar czf"], ["zip archive", ".zip", %w"zip -qr"] ].collect do |mesg, ext, cmd| - file = "#{destdir}/#{v}#{ext}" + file = "#{destdir}/#{v||$archname}#{ext}" print "creating #{mesg}... #{file}" if system(*(cmd + [file, v])) puts " done" -- cgit v1.2.3