summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-25 15:46:02 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-25 15:46:02 +0000
commit213d2aa629bb98bb12eec25fe2f408d68dd1891e (patch)
tree3f9958163e3653a57676afc553be586e0d4f5e9a /tool/make-snapshot
parent9805cb9457e4cd80d97d4cd26469e9fc04ea89b7 (diff)
* tool/make-snapshot: support new version scheme.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot30
1 files changed, 23 insertions, 7 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 20f18a3..a3a90f9 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|