diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-23 15:49:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-23 15:49:10 +0000 |
commit | 81ab413288b935d4c09cf9b3547c4d3913671874 (patch) | |
tree | ccc6305c6f420fdc2b2e47054d009ecc668e56ff | |
parent | de4181735161a4a4bbb3771ebb30bd620c243b06 (diff) |
fix GraphemeBreakProperty.txt
* tool/downloader.rb: download to the file given in ARGV.
* tool/enc-unicode.rb (parse_GraphemeBreakProperty): fix data file
path as $(UNICODE_PROPERTY_FILES) in common.mk.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | tool/downloader.rb | 26 | ||||
-rwxr-xr-x | tool/enc-unicode.rb | 2 |
3 files changed, 19 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore index 80446a2c69..947599d6e9 100644 --- a/.gitignore +++ b/.gitignore @@ -127,6 +127,7 @@ y.tab.c /enc/*.exp /enc/*.lib /enc/unicode/data/*/*.txt +/enc/unicode/data/*/*/*.txt # /enc/trans/ /enc/trans/*.c diff --git a/tool/downloader.rb b/tool/downloader.rb index 941c1e7d51..b2f561d82c 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -127,17 +127,17 @@ class Downloader options.delete(:verify) file = under(dir, name) dryrun = options.delete(:dryrun) - if dryrun - puts "Download #{url} into #{file}" - return false - end if since.nil? and File.exist?(file) if $VERBOSE - $stdout.puts "#{name} already exists" + $stdout.puts "#{file} already exists" $stdout.flush end return true end + if dryrun + puts "Download #{url} into #{file}" + return false + end if !https? and url.start_with?("https:") warn "*** using http instead of https ***" url = url.sub(/\Ahttps/, 'http') @@ -237,14 +237,22 @@ if $0 == __FILE__ dl = Downloader.const_get(dl) ARGV.shift ARGV.each do |name| + dir = destdir if prefix - if name.include?('/auxiliary/') - name = "#{prefix}/auxiliary/#{File.basename(name)}" + name = name.sub(/\A\.\//, '') + if name.start_with?(destdir+"/") + name = name[(destdir.size+1)..-1] + if (dir = File.dirname(name)) == '.' + dir = destdir + else + dir = File.join(destdir, dir) + end else - name = "#{prefix}/#{File.basename(name)}" + name = File.basename(name) end + name = "#{prefix}/#{name}" end - dl.download(name, destdir, since, options) + dl.download(name, dir, since, options) end else abort "usage: #{$0} url name" unless ARGV.size == 2 diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index 14ed5d076c..220c46c8ef 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -212,7 +212,7 @@ def parse_GraphemeBreakProperty(data) current = nil cps = [] ages = [] - data_foreach('GraphemeBreakProperty.txt') do |line| + data_foreach('auxiliary/GraphemeBreakProperty.txt') do |line| if /^# Total code points: / =~ line constname = constantize_Grapheme_Cluster_Break(current) data[constname] = cps |