mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
40cc9231a9
commit
39713bd927
2 changed files with 21 additions and 14 deletions
29
common.mk
29
common.mk
|
@ -10,6 +10,8 @@ Q1 = $(V:1=)
|
||||||
Q = $(Q1:0=@)
|
Q = $(Q1:0=@)
|
||||||
ECHO = $(ECHO1:0=@echo)
|
ECHO = $(ECHO1:0=@echo)
|
||||||
|
|
||||||
|
UNICODE_VERSION = 7.0.0
|
||||||
|
|
||||||
RUBYLIB = $(PATH_SEPARATOR)
|
RUBYLIB = $(PATH_SEPARATOR)
|
||||||
RUBYOPT = -
|
RUBYOPT = -
|
||||||
RUN_OPTS = --disable-gems
|
RUN_OPTS = --disable-gems
|
||||||
|
@ -1103,21 +1105,25 @@ update-gems: PHONY
|
||||||
### the Unicode data files are updated every minute.
|
### the Unicode data files are updated every minute.
|
||||||
# ALWAYS_UPDATE_UNICODE = yes
|
# ALWAYS_UPDATE_UNICODE = yes
|
||||||
|
|
||||||
UNICODE_FILES = $(srcdir)/enc/unicode/data/UnicodeData.txt \
|
UNICODE_FILES = $(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/UnicodeData.txt \
|
||||||
$(srcdir)/enc/unicode/data/CompositionExclusions.txt \
|
$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/CompositionExclusions.txt \
|
||||||
$(srcdir)/enc/unicode/data/NormalizationTest.txt
|
$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)/NormalizationTest.txt
|
||||||
|
|
||||||
update-unicode: $(UNICODE_FILES) PHONY
|
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_FILES_DEPS = $(ALWAYS_UPDATE_UNICODE:yes=PHONY)
|
||||||
|
|
||||||
./.update-unicode.time: $(UPDATE_UNICODE_FILES_DEPS:no=)
|
./.unicode-tables.time: ./.unicode-$(UNICODE_VERSION).time
|
||||||
$(ECHO) Downloading Unicode data files...
|
./.unicode-$(UNICODE_VERSION).time: $(UPDATE_UNICODE_FILES_DEPS:no=)
|
||||||
$(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data"
|
$(ECHO) Downloading Unicode $(UNICODE_VERSION) data files...
|
||||||
$(Q) $(BASERUBY) -C "$(srcdir)/enc/unicode/data" \
|
$(Q) $(MAKEDIRS) "$(srcdir)/enc/unicode/data/$(UNICODE_VERSION)"
|
||||||
../../../tool/downloader.rb -e $(ALWAYS_UPDATE_UNICODE:yes=-a) unicode \
|
$(Q) $(BASERUBY) -C "$(srcdir)" tool/downloader.rb \
|
||||||
UnicodeData.txt CompositionExclusions.txt NormalizationTest.txt
|
-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
|
@exit > .update-unicode.time
|
||||||
|
|
||||||
$(srcdir)/lib/unicode_normalize/tables.rb: ./.unicode-tables.time
|
$(srcdir)/lib/unicode_normalize/tables.rb: ./.unicode-tables.time
|
||||||
|
@ -1127,7 +1133,8 @@ $(srcdir)/lib/unicode_normalize/tables.rb: ./.unicode-tables.time
|
||||||
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
|
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
|
||||||
-c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
|
-c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
|
||||||
-I $(srcdir) \
|
-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: info-program info-libruby_a info-libruby_so info-arch
|
||||||
info-program: PHONY
|
info-program: PHONY
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Downloader
|
||||||
|
|
||||||
class Unicode < self
|
class Unicode < self
|
||||||
def self.download(name, *rest)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class Downloader
|
||||||
# download 'http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt',
|
# download 'http://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt',
|
||||||
# 'UnicodeData.txt', 'enc/unicode/data'
|
# 'UnicodeData.txt', 'enc/unicode/data'
|
||||||
def self.download(url, name, dir = nil, ims = true)
|
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)
|
return true if ims.nil? and File.exist?(file)
|
||||||
url = URI(url)
|
url = URI(url)
|
||||||
if $VERBOSE
|
if $VERBOSE
|
||||||
|
@ -124,7 +124,7 @@ if $0 == __FILE__
|
||||||
end
|
end
|
||||||
dl = Downloader.constants.find do |name|
|
dl = Downloader.constants.find do |name|
|
||||||
ARGV[0].casecmp(name.to_s) == 0
|
ARGV[0].casecmp(name.to_s) == 0
|
||||||
end
|
end unless ARGV.empty?
|
||||||
$VERBOSE = true
|
$VERBOSE = true
|
||||||
if dl
|
if dl
|
||||||
dl = Downloader.const_get(dl)
|
dl = Downloader.const_get(dl)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue