summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-28 07:13:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-28 07:13:39 +0000
commitb39833e1d768c5461cbf1475367677eb0ec15ba3 (patch)
tree057cbeb0a73b5afd770ea29ad976ab84c4d1dbdf /tool/make-snapshot
parent993a9404cbdef5d99a04fd4920e10829301e9777 (diff)
* tool/make-snapshot: use String#bytesize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot10
1 files changed, 8 insertions, 2 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 7ad64bd55d..134a6e6d4c 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -1,4 +1,5 @@
#!/usr/bin/ruby -s
+# -*- encoding: us-ascii -*-
require 'uri'
require 'digest/md5'
require 'digest/sha2'
@@ -20,6 +21,11 @@ ENV["RUBY"] ||= "ruby"
ENV["MV"] ||= "mv"
ENV["MINIRUBY"] ||= "ruby"
+class String
+ # for older ruby
+ alias bytesize size unless method_defined?(:bytesize)
+end
+
$patch_file &&= File.expand_path($patch_file)
path = ENV["PATH"].split(File::PATH_SEPARATOR)
%w[YACC BASERUBY RUBY MV MINIRUBY].each do |var|
@@ -56,7 +62,7 @@ def package(rev, destdir)
when /\Astable\z/
url = SVNURL + "branches/"
url = url + `svn ls #{url}`[/.*^(ruby_\d+_\d+)\//m, 1]
- when /\A(.*)\.(.*)\.(.*)-(p)?(.*)/
+ when /\A(.*)\.(.*)\.(.*)-((?!preview)p)?(.*)/
patchlevel = !!$4
tag = "#{$4}#{$5}"
url = SVNURL + "tags/v#{$1}_#{$2}_#{$3}_#{$5}"
@@ -196,6 +202,6 @@ revisions.collect {|rev| package(rev, destdir)}.flatten.each do |name|
sha = Digest::SHA256.hexdigest str
puts "MD5(#{name})= #{md5}"
puts "SHA256(#{name})= #{sha}"
- puts "SIZE(name)= #{str.size}"
+ puts "SIZE(name)= #{str.bytesize}"
puts
end