summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-20 08:14:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-20 08:14:24 +0000
commitc23cb3adbe651e0fa6f3690e3df55e83cdfa6579 (patch)
tree36b8057fd2ccc4ac4c542d1677476338662534a6
parent2b02ffa985d3b6419b91f3bae9bd22bc89fb7dc9 (diff)
downloadruby-c23cb3adbe651e0fa6f3690e3df55e83cdfa6579.tar.gz
extlibs.rb: add --cache option
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rwxr-xr-xtool/extlibs.rb44
2 files changed, 31 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index dc445d8492..30f2772f23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jan 20 17:13:39 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+
+
Tue Jan 19 17:03:40 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* common.mk: Added Unicode data file CaseFolding.txt to be additionally
diff --git a/tool/extlibs.rb b/tool/extlibs.rb
index 6323d8fdcd..710d8433b5 100755
--- a/tool/extlibs.rb
+++ b/tool/extlibs.rb
@@ -3,9 +3,6 @@ require 'fileutils'
require 'digest'
require_relative 'downloader'
-cache_dir = ".downloaded-cache"
-FileUtils.mkdir_p(cache_dir)
-
def do_download(url, base, cache_dir)
Downloader.download(url, base, cache_dir, nil)
end
@@ -74,23 +71,36 @@ def do_patch(dest, patch, args)
$?.success? or raise "failed to patch #{patch}"
end
-case ARGV[0]
-when '--download'
- mode = :download
- ARGV.shift
-when '--extract'
- mode = :extract
- ARGV.shift
-when '--patch'
- mode = :patch
- ARGV.shift
-when '--all'
- mode = :all
+cache_dir = ENV['CACHE_DIR'] || ".downloaded-cache"
+mode = :all
+until ARGV.empty?
+ case ARGV[0]
+ when '--download'
+ mode = :download
+ when '--extract'
+ mode = :extract
+ when '--patch'
+ mode = :patch
+ when '--all'
+ mode = :all
+ when '--cache'
+ ARGV.shift
+ cache_dir = ARGV[0]
+ when /\A--cache=/
+ cache_dir = $'
+ when '--'
+ ARGV.shift
+ break
+ when /\A-/
+ abort "unknown option: #{ARGV[0]}"
+ else
+ break
+ end
ARGV.shift
-else
- mode = :all
end
+FileUtils.mkdir_p(cache_dir)
+
success = true
ARGV.each do |dir|
Dir.glob("#{dir}/**/extlibs") do |list|