ruby-changes:32346
From: usa <ko1@a...>
Date: Thu, 26 Dec 2013 00:46:17 +0900 (JST)
Subject: [ruby-changes:32346] usa:r44425 (trunk): * tool/make-snapshot: support new version scheme.
usa 2013-12-26 00:46:02 +0900 (Thu, 26 Dec 2013) New Revision: 44425 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44425 Log: * tool/make-snapshot: support new version scheme. Modified files: trunk/ChangeLog trunk/tool/make-snapshot Index: ChangeLog =================================================================== --- ChangeLog (revision 44424) +++ ChangeLog (revision 44425) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Dec 26 00:45:33 2013 NAKAMURA Usaku <usa@r...> + + * tool/make-snapshot: support new version scheme. + Wed Dec 25 22:44:14 2013 Nobuyoshi Nakada <nobu@r...> * compile.c (iseq_set_arguments): set arg_keyword_check from Index: tool/make-snapshot =================================================================== --- tool/make-snapshot (revision 44424) +++ tool/make-snapshot (revision 44425) @@ -118,8 +118,14 @@ def package(rev, destdir) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L118 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) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L168 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) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L181 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) https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L195 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| -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/