[前][次][番号順一覧][スレッド一覧]

ruby-changes:45998

From: nobu <ko1@a...>
Date: Fri, 24 Mar 2017 00:49:14 +0900 (JST)
Subject: [ruby-changes:45998] nobu:r58069 (trunk): fix GraphemeBreakProperty.txt

nobu	2017-03-24 00:49:10 +0900 (Fri, 24 Mar 2017)

  New Revision: 58069

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58069

  Log:
    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.

  Modified files:
    trunk/.gitignore
    trunk/tool/downloader.rb
    trunk/tool/enc-unicode.rb
Index: .gitignore
===================================================================
--- .gitignore	(revision 58068)
+++ .gitignore	(revision 58069)
@@ -127,6 +127,7 @@ y.tab.c https://github.com/ruby/ruby/blob/trunk/.gitignore#L127
 /enc/*.exp
 /enc/*.lib
 /enc/unicode/data/*/*.txt
+/enc/unicode/data/*/*/*.txt
 
 # /enc/trans/
 /enc/trans/*.c
Index: tool/enc-unicode.rb
===================================================================
--- tool/enc-unicode.rb	(revision 58068)
+++ tool/enc-unicode.rb	(revision 58069)
@@ -212,7 +212,7 @@ def parse_GraphemeBreakProperty(data) https://github.com/ruby/ruby/blob/trunk/tool/enc-unicode.rb#L212
   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
Index: tool/downloader.rb
===================================================================
--- tool/downloader.rb	(revision 58068)
+++ tool/downloader.rb	(revision 58069)
@@ -127,17 +127,17 @@ class Downloader https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L127
     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__ https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L237
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]