diff --git a/ChangeLog b/ChangeLog index 8bdf25b6e3..85aa86f472 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Dec 26 00:45:33 2013 NAKAMURA Usaku + + * tool/make-snapshot: support new version scheme. + Wed Dec 25 22:44:14 2013 Nobuyoshi Nakada * compile.c (iseq_set_arguments): set arg_keyword_check from diff --git a/tool/make-snapshot b/tool/make-snapshot index 20f18a301f..a3a90f94d3 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -118,8 +118,14 @@ def package(rev, destdir) patchlevel = true tag = "p#{$4}" url = SVNURL + "tags/v#{$1}_#{$2}_#{$3}_#{$4}" - when /\./ - url = SVNURL + "branches/ruby_#{rev.tr('.', '_')}" + when /\A(\d+)\.(\d+)\.(\d+)\z/ + if $1 > "2" || $1 == "2" && $2 >= "1" + patchlevel = true + tag = "" + url = SVNURL + "tags/v#{$1}_#{$2}_#{$3}" + else + url = SVNURL + "branches/ruby_#{rev.tr('.', '_')}" + end else warn "#{$0}: unknown version - #{rev}" return @@ -162,9 +168,11 @@ def package(rev, destdir) version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1] version or return if patchlevel - versionhdr ||= IO.read("#{v}/version.h") - patchlevel = versionhdr[/^\#define\s+RUBY_PATCHLEVEL\s+(\d+)/, 1] - tag = (patchlevel ? "p#{patchlevel}" : "r#{revision}") + unless tag.empty? + versionhdr ||= IO.read("#{v}/version.h") + patchlevel = versionhdr[/^\#define\s+RUBY_PATCHLEVEL\s+(\d+)/, 1] + tag = (patchlevel ? "p#{patchlevel}" : "r#{revision}") + end elsif prerelease versionhdr ||= IO.read("#{v}/version.h") versionhdr.sub!(/^\#define\s+RUBY_PATCHLEVEL_STR\s+"\K.+?(?=")/, tag) @@ -173,7 +181,11 @@ def package(rev, destdir) tag ||= "r#{revision}" end unless v == $exported - n = "ruby-#{version}-#{tag}" + if tag.empty? + n = "ruby-#{version}" + else + n = "ruby-#{version}-#{tag}" + end File.directory?(n) or File.rename v, n v = n end @@ -183,7 +195,11 @@ def package(rev, destdir) Dir.chdir(v) do %w[config.guess config.sub].each do |conf| next if File.exist?("tool/#{conf}") - require File.expand_path("config_files", $tooldir) + begin + require File.expand_path("config_files", $tooldir) + rescue LoadError + abort "Error!!! Copy 'config_files.rb' from 'tool' directory of the recent ruby repository!" + end ConfigFiles.download(conf, "tool") end File.open(clean.add("cross.rb"), "w") do |f|