aboutsummaryrefslogtreecommitdiffstats
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 02:28:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 10:55:37 +0900
commitfd658ec821f07e0a2254fcd62ce29cc644d61302 (patch)
tree4cb533bb8563fed8c311a43361fab4a7d0fa8b18 /tool/make-snapshot
parente8c710b11a02c6ab82b358fc671a14f378cb1974 (diff)
downloadruby-fd658ec821f07e0a2254fcd62ce29cc644d61302.tar.gz
Define RUBY_FULL_REVISION
Only if the short revision differs from the full revision.
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot8
1 files changed, 7 insertions, 1 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 57eb195d1c..3e90adba48 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -291,7 +291,13 @@ def package(vcs, rev, destdir, tmp = nil)
v = v[0]
end
- open("#{v}/revision.h", "wb") {|f| f.puts "#define RUBY_REVISION #{revision.dump}"}
+ 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}"
+ end
+ }
version ||= (versionhdr = IO.read("#{v}/version.h"))[RUBY_VERSION_PATTERN, 1]
version ||=
begin