summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-20 20:46:21 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-20 20:46:21 +0000
commit0abe1fee1308037e7f765900defd379acc1a1674 (patch)
treefac959decc8e1532e2cffd13c309e31a27832758 /tool/make-snapshot
parent4ed5aeca05d768b1bbeb497591c4ff35edef0fbd (diff)
* tool/make-snapshot: replace RUBY_PATCHLEVEL_STR in version.h to
show users that this ruby is a preview/rc version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot6
1 files changed, 6 insertions, 0 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 962ac07..20f18a3 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -100,6 +100,7 @@ Dir.chdir tmp
def package(rev, destdir)
patchlevel = false
+ prerelease = false
if revision = rev[/@(\d+)\z/, 1]
rev = $`
end
@@ -110,6 +111,7 @@ def package(rev, destdir)
url = SVNURL + "branches/"
url = url + `svn ls #{url}`[/.*^(ruby_\d+_\d+)\//m, 1]
when /\A(.*)\.(.*)\.(.*)-(preview|rc)(\d+)/
+ prerelease = true
tag = "#{$4}#{$5}"
url = SVNURL + "tags/v#{$1}_#{$2}_#{$3}_#{$4}#{$5}"
when /\A(.*)\.(.*)\.(.*)-p(\d+)/
@@ -163,6 +165,10 @@ def package(rev, destdir)
versionhdr ||= IO.read("#{v}/version.h")
patchlevel = versionhdr[/^\#define\s+RUBY_PATCHLEVEL\s+(\d+)/, 1]
tag = (patchlevel ? "p#{patchlevel}" : "r#{revision}")
+ elsif prerelease
+ versionhdr ||= IO.read("#{v}/version.h")
+ versionhdr.sub!(/^\#define\s+RUBY_PATCHLEVEL_STR\s+"\K.+?(?=")/, tag)
+ IO.write("#{v}/version.h", versionhdr)
else
tag ||= "r#{revision}"
end