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

ruby-changes:54227

From: duerst <ko1@a...>
Date: Wed, 19 Dec 2018 09:26:36 +0900 (JST)
Subject: [ruby-changes:54227] duerst:r66448 (trunk): add option to deal with Unicode beta data files

duerst	2018-12-19 09:26:31 +0900 (Wed, 19 Dec 2018)

  New Revision: 66448

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

  Log:
    add option to deal with Unicode beta data files
    
    Unicode uses file names with explicit versions for beta publication.
    This commit introduces a variable on the makefile level to distinguish
    between beta and regular versions of file names.
     
    common.mk: Define new variable UNICODE_BETA, usually set to NO,
    but would be YES during tests with beta data files. Pass the value
    of this variable to tool/downloader.rb with option --unicode-beta.
    
    tool/downloader.rb: Receive and store value of --unicode-beta.
    Raise an exception if value is YES, because we don't yet actually
    deal with this case. Continue as usual if value is not YES.
    
    This completes the changes needed in the makefile. Upcomming changes
    will only affect tool/downloader.rb.

  Modified files:
    trunk/common.mk
    trunk/tool/downloader.rb
Index: common.mk
===================================================================
--- common.mk	(revision 66447)
+++ common.mk	(revision 66448)
@@ -17,6 +17,7 @@ enable_shared = $(ENABLE_SHARED:no=) https://github.com/ruby/ruby/blob/trunk/common.mk#L17
 
 UNICODE_VERSION = 11.0.0
 UNICODE_EMOJI_VERSION = 11.0
+UNICODE_BETA = NO
 
 ### set the following environment variable or uncomment the line if
 ### the Unicode data files should be updated completely on every update ('make up',...).
@@ -1318,12 +1319,14 @@ CACHE_DIR = $(srcdir)/.downloaded-cache https://github.com/ruby/ruby/blob/trunk/common.mk#L1319
 UNICODE_DOWNLOAD = \
 	$(BASERUBY) $(srcdir)/tool/downloader.rb \
 	    --cache-dir=$(CACHE_DIR) \
+	    --unicode-beta $(UNICODE_BETA) \
 	    -d $(UNICODE_SRC_DATA_DIR) \
 	    -p $(UNICODE_VERSION)/ucd \
 	    -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
 UNICODE_EMOJI_DOWNLOAD = \
 	$(BASERUBY) $(srcdir)/tool/downloader.rb \
 	    --cache-dir=$(CACHE_DIR) \
+	    --unicode-beta $(UNICODE_BETA) \
 	    -d $(UNICODE_SRC_EMOJI_DATA_DIR) \
 	    -p emoji/$(UNICODE_EMOJI_VERSION) \
 	    -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode
Index: tool/downloader.rb
===================================================================
--- tool/downloader.rb	(revision 66447)
+++ tool/downloader.rb	(revision 66448)
@@ -310,6 +310,15 @@ if $0 == __FILE__ https://github.com/ruby/ruby/blob/trunk/tool/downloader.rb#L310
     when '--cache-dir'
       options[:cache_dir] = ARGV[1]
       ARGV.shift
+    when '--unicode-beta'
+      options[:unicode_beta] = ARGV[1]
+      ARGV.shift
+      # TODO: Move this code further down
+      if options[:unicode_beta]=='YES'
+        raise "Not yet able to deal with Unicode Data beta versions."
+      else
+        # TODO: deal with the case that we just switched from beta to 'regular'
+      end
     when /\A--cache-dir=(.*)/m
       options[:cache_dir] = $1
     when /\A-/

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

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