From ffbcf9f842d228e4a95b13f415dfc4e141e8f4f0 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 17 Apr 2019 07:35:29 +0000 Subject: downloader.rb: enable cache files * tool/downloader.rb (Downloader::Unicode.download): enable cache files when index.html has not been modified since the previous download, even if beta version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/downloader.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tool') diff --git a/tool/downloader.rb b/tool/downloader.rb index 5c1bcc35fd..d46ffa671a 100644 --- a/tool/downloader.rb +++ b/tool/downloader.rb @@ -81,15 +81,17 @@ class Downloader if INDEX.size == 0 index_options = options.dup index_options[:cache_save] = false # TODO: make sure caching really doesn't work for index file + index_data = File.read(under(dir, "index.html")) rescue nil index_file = super(UNICODE_PUBLIC+name_dir_part, "#{name_dir_part}index.html", dir, true, index_options) INDEX[:index] = File.read(index_file) + since = true unless INDEX[:index] == index_data end file_base = File.basename(name, '.txt') return if file_base == '.' # Use pre-generated headers and tables beta_name = INDEX[:index][/#{Regexp.quote(file_base)}(-[0-9.]+d\d+)?\.txt/] # make sure we always check for new versions of files, # because they can easily change in the beta period - super(UNICODE_PUBLIC+name_dir_part+beta_name, name, dir, true, options) + super(UNICODE_PUBLIC+name_dir_part+beta_name, name, dir, since, options) else index_file = Pathname.new(under(dir, name_dir_part+'index.html')) if index_file.exist? -- cgit v1.2.3