summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.mk2
-rw-r--r--tool/downloader.rb12
2 files changed, 8 insertions, 6 deletions
diff --git a/common.mk b/common.mk
index b296356..7b0f019 100644
--- a/common.mk
+++ b/common.mk
@@ -893,7 +893,7 @@ update-gems: PHONY
-I../tool -rdownloader -answ \
-e 'gem, ver = *$$F' \
-e 'gem = "#{gem}-#{ver}.gem"' \
- -e 'Downloader::RubyGems.download(gem)' \
+ -e 'Downloader::RubyGems.download(gem, nil, nil)' \
bundled_gems
UPDATE_LIBRARIES = no
diff --git a/tool/downloader.rb b/tool/downloader.rb
index 1149424..c2fc638 100644
--- a/tool/downloader.rb
+++ b/tool/downloader.rb
@@ -9,10 +9,6 @@ class Downloader
class RubyGems < self
def self.download(name, *rest)
- if File.exist?(name)
- $stdout.puts "#{name} already exists"
- return
- end
super("https://rubygems.org/downloads/#{name}", name, *rest)
end
end
@@ -58,7 +54,13 @@ class Downloader
# 'UnicodeData.txt', 'enc/unicode/data'
def self.download(url, name, dir = nil, ims = true)
file = dir ? File.join(dir, File.basename(name)) : name
- return true if ims.nil? and File.exist?(file)
+ if ims.nil? and File.exist?(file)
+ if $VERBOSE
+ $stdout.puts "#{name} already exists"
+ $stdout.flush
+ end
+ return true
+ end
url = URI(url)
if $VERBOSE
$stdout.print "downloading #{name} ... "