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

ruby-changes:36115

From: nobu <ko1@a...>
Date: Thu, 30 Oct 2014 16:40:01 +0900 (JST)
Subject: [ruby-changes:36115] nobu:r48196 (trunk): common.mk: separate Unicode files directory

nobu	2014-10-30 16:39:51 +0900 (Thu, 30 Oct 2014)

  New Revision: 48196

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

  Log:
    common.mk: separate Unicode files directory
    
    * common.mk: download Unicode files into separate directory for the
      version.
    
    * tool/downloader.rb (Downloader::Unicode.download): strip version
      directory.
    
    * tool/downloader.rb (Downloader.download): strip directory name
      if download directory is given.

  Modified files:
    trunk/common.mk
    trunk/tool/downloader.rb
Index: common.mk
===================================================================
--- common.mk	(revision 48195)
+++ common.mk	(revision 48196)
@@ -10,6 +10,8 @@ Q1 = $(V:1=) https://github.com/ruby/ruby/blob/trunk/common.mk#L10
 Q = $(Q1:0=@)
 ECHO = $(ECHO1:0=@echo)
 
+UNICODE_VERSION = 7.0.0
+
 RUBYLIB       = $(PATH_SEPARATOR)
 RUBYOPT       = -
 RUN_OPTS      = --disable-gems
@@ -1103,21 +1105,25 @@ update-gems: PHONY https://github.com/ruby/ruby/blob/trunk/common.mk#L1105
 ### the Unicode data files are updated every minute.
 # ALWAYS_UPDATE_UNICODE = yes
 
-UNICODE_FILES = $(srcdir)/enc/unicode/data/UnicodeData.txt \
-		$(srcdir)/enc/unicode/data/CompositionExclusions.txt \
-		$(srcdir)/enc/unicode/data/NormalizationTest.txt
+UNICODE_FILES = $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/UnicodeData.txt \
+		$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/CompositionExclusions.txt \
+		$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/NormalizationTest.txt
 
 update-unicode: $(UNICODE_FILES) PHONY
-$(UNICODE_FILES): ./.update-unicode.time
+$(UNICODE_FILES): ./.unicode-$(UNICODE_VERSION).time
 
 UPDATE_UNICODE_FILES_DEPS = $(ALWAYS_UPDATE_UNICODE:yes=PHONY)
 
-./.update-unicode.time: $(UPDATE_UNICODE_FILES_DEPS:no=)
-	$(ECHO) Downloading Unicode data files...
-	$(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data"
-	$(Q) $(BASERUBY) -C "$(srcdir)/enc/unicode/data" \
-	    ../../../tool/downloader.rb -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode \
-	    UnicodeData.txt CompositionExclusions.txt NormalizationTest.txt
+./.unicode-tables.time: ./.unicode-$(UNICODE_VERSION).time
+./.unicode-$(UNICODE_VERSION).time: $(UPDATE_UNICODE_FILES_DEPS:no=)
+	$(ECHO) Downloading Unicode $(UNICODE_VERSION) data files...
+	$(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)"
+	$(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb \
+	    -d enc/unicode/data/$(UNICODE_VERSION) \
+	    -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode \
+	    $(UNICODE_VERSION)/ucd/UnicodeData.txt \
+	    $(UNICODE_VERSION)/ucd/CompositionExclusions.txt \
+	    $(UNICODE_VERSION)/ucd/NormalizationTest.txt
 	@exit > .update-unicode.time
 
 $(srcdir)/lib/unicode_normalize/tables.rb: ./.unicode-tables.time
@@ -1127,7 +1133,8 @@ $(srcdir)/lib/unicode_normalize/tables.r https://github.com/ruby/ruby/blob/trunk/common.mk#L1133
 	$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
 		-c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
 		-I $(srcdir) \
-		$(srcdir)/template/unicode_norm_gen.tmpl enc/unicode/data lib/unicode_normalize
+		$(srcdir)/template/unicode_norm_gen.tmpl \
+		enc/unicode/data/$(UNICODE_VERSION) lib/unicode_normalize
 
 info: info-program info-libruby_a info-libruby_so info-arch
 info-program: PHONY
Index: tool/downloader.rb
===================================================================
--- tool/downloader.rb	(revision 48195)
+++ tool/downloader.rb	(revision 48196)
@@ -17,7 +17,7 @@ class Downloader https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L17
 
   class Unicode < self
     def self.download(name, *rest)
-      super("http://www.unicode.org/Public/7.0.0/ucd/#{name}", name, *rest)
+      super("http://www.unicode.org/Public/#{name}", name, *rest)
     end
   end
 
@@ -53,7 +53,7 @@ class Downloader https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L53
   #   download 'http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt',
   #            'UnicodeData.txt', 'enc/unicode/data'
   def self.download(url, name, dir = nil, ims = true)
-    file = dir ? File.join(dir, name) : name
+    file = dir ? File.join(dir, File.basename(name)) : name
     return true if ims.nil? and File.exist?(file)
     url = URI(url)
     if $VERBOSE
@@ -124,7 +124,7 @@ if $0 == __FILE__ https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L124
   end
   dl = Downloader.constants.find do |name|
     ARGV[0].casecmp(name.to_s) == 0
-  end
+  end unless ARGV.empty?
   $VERBOSE = true
   if dl
     dl = Downloader.const_get(dl)

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

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