ruby-changes:54575
From: kazu <ko1@a...>
Date: Fri, 11 Jan 2019 13:58:39 +0900 (JST)
Subject: [ruby-changes:54575] kazu:r66790 (trunk): Fix make-snapshot for trunk
kazu 2019-01-11 13:58:33 +0900 (Fri, 11 Jan 2019) New Revision: 66790 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66790 Log: Fix make-snapshot for trunk Modified files: trunk/tool/make-snapshot trunk/tool/mkconfig.rb Index: tool/mkconfig.rb =================================================================== --- tool/mkconfig.rb (revision 66789) +++ tool/mkconfig.rb (revision 66790) @@ -201,6 +201,12 @@ IO.foreach(File.join(srcdir, "version.h" https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L201 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" https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L214 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 Index: tool/make-snapshot =================================================================== --- tool/make-snapshot (revision 66789) +++ tool/make-snapshot (revision 66790) @@ -285,6 +285,14 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L285 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 https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L392 "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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/