diff options
author | NAKAMURA Usaku <usa@ruby-lang.org> | 2019-08-28 00:19:25 +0900 |
---|---|---|
committer | NAKAMURA Usaku <usa@ruby-lang.org> | 2019-08-28 00:19:25 +0900 |
commit | 6454808c52fff445ff09fefb0fb96988f82aaa3c (patch) | |
tree | 5ed2f614de9e5bfaeea21f7c7e946e7eb4eeb995 | |
parent | dd032a5fb4dd8da59c685910b3c673439edc8c42 (diff) | |
download | ruby-6454808c52fff445ff09fefb0fb96988f82aaa3c.tar.gz |
Treat RUBY_REVISION as an integer on old rubies
-rwxr-xr-x | tool/make-snapshot | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot index 9199cc2097..1ad6682985 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -293,10 +293,14 @@ def package(vcs, rev, destdir, tmp = nil) end open("#{v}/revision.h", "wb") {|f| - short = vcs.short_revision(revision) - f.puts "#define RUBY_REVISION #{short.inspect}" - unless short == revision - f.puts "#define RUBY_FULL_REVISION #{revision.inspect}" + if revision.length <= 6 && revision.to_i.to_s == revision + f.puts "#define RUBY_REVISION #{revision.to_i}" + else + short = vcs.short_revision(revision) + f.puts "#define RUBY_REVISION #{short.inspect}" + unless short == revision + f.puts "#define RUBY_FULL_REVISION #{revision.inspect}" + end end } version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1] |