зеркало из https://github.com/github/ruby.git
Fix make-snapshot for trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
bdc36b360e
Коммит
e4f46eabab
|
@ -285,6 +285,14 @@ def package(vcs, rev, destdir, tmp = nil)
|
|||
|
||||
open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision}"}
|
||||
version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
|
||||
version ||=
|
||||
begin
|
||||
include_ruby_versionhdr = IO.read("#{v}/include/ruby/version.h")
|
||||
api_major_version = include_ruby_versionhdr[/^\#define\s+RUBY_API_VERSION_MAJOR\s+([\d.]+)/, 1]
|
||||
api_minor_version = include_ruby_versionhdr[/^\#define\s+RUBY_API_VERSION_MINOR\s+([\d.]+)/, 1]
|
||||
version_teeny = versionhdr[/^\#define\s+RUBY_VERSION_TEENY\s+(\d+)/, 1]
|
||||
[api_major_version, api_minor_version, version_teeny].join('.')
|
||||
end
|
||||
version or return
|
||||
if patchlevel
|
||||
unless tag.empty?
|
||||
|
@ -384,6 +392,9 @@ def package(vcs, rev, destdir, tmp = nil)
|
|||
"BASERUBY"=>baseruby,
|
||||
"PWD"=>Dir.pwd,
|
||||
"ruby_version"=>version,
|
||||
"MAJOR"=>api_major_version,
|
||||
"MINOR"=>api_minor_version,
|
||||
"TEENY"=>version_teeny,
|
||||
}
|
||||
status.scan(/^s([%,])@([A-Za-z_][A-Za-z_0-9]*)@\1(.*?)\1g$/) do
|
||||
vars[$2] ||= $3
|
||||
|
|
|
@ -201,6 +201,12 @@ IO.foreach(File.join(srcdir, "version.h")) do |l|
|
|||
break if versions.size == 4
|
||||
next
|
||||
end
|
||||
m = /^\s*#\s*define\s+RUBY_VERSION_(\w+)\s+(-?\d+)/.match(l)
|
||||
if m
|
||||
versions[m[1]] = m[2]
|
||||
break if versions.size == 4
|
||||
next
|
||||
end
|
||||
m = /^\s*#\s*define\s+RUBY_VERSION\s+\W?([.\d]+)/.match(l)
|
||||
if m
|
||||
versions['MAJOR'], versions['MINOR'], versions['TEENY'] = m[1].split('.')
|
||||
|
@ -208,6 +214,16 @@ IO.foreach(File.join(srcdir, "version.h")) do |l|
|
|||
next
|
||||
end
|
||||
end
|
||||
if versions.size != 4
|
||||
IO.foreach(File.join(srcdir, "include/ruby/version.h")) do |l|
|
||||
m = /^\s*#\s*define\s+RUBY_API_VERSION_(\w+)\s+(-?\d+)/.match(l)
|
||||
if m
|
||||
versions[m[1]] ||= m[2]
|
||||
break if versions.size == 4
|
||||
next
|
||||
end
|
||||
end
|
||||
end
|
||||
%w[MAJOR MINOR TEENY PATCHLEVEL].each do |v|
|
||||
print " CONFIG[#{v.dump}] = #{(versions[v]||vars[v]).dump}\n"
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче