aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/fetch.rb
diff options
context:
space:
mode:
authorJack Nagel2013-10-31 14:28:49 -0500
committerJack Nagel2013-10-31 14:29:48 -0500
commit3f2782e22de1cbf2bf2f6eda188561f3600afc8b (patch)
treed43604bc0e58b7120a38ebd1d039e9b90bb7a85f /Library/Homebrew/cmd/fetch.rb
parentd35e4656710ab55eff60c8fa6cf6fc380b6cb940 (diff)
downloadbrew-3f2782e22de1cbf2bf2f6eda188561f3600afc8b.tar.bz2
fetch: check for existing cache file before downloading
Diffstat (limited to 'Library/Homebrew/cmd/fetch.rb')
-rw-r--r--Library/Homebrew/cmd/fetch.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb
index c968e6003..1fcc5b28e 100644
--- a/Library/Homebrew/cmd/fetch.rb
+++ b/Library/Homebrew/cmd/fetch.rb
@@ -24,10 +24,6 @@ module Homebrew extend self
end
end
- def already_fetched? f
- f.cached_download.exist?
- end
-
def fetch_resource r
puts "Resource: #{r.name}"
fetch_fetchable r
@@ -47,11 +43,13 @@ module Homebrew extend self
def fetch_fetchable f
f.clear_cache if ARGV.force?
+
+ already_fetched = f.cached_download.exist?
download = f.fetch
return unless download.file?
- puts "Downloaded to: #{download}" unless already_fetched?(f)
+ puts "Downloaded to: #{download}" unless already_fetched
puts Checksum::TYPES.map { |t| "#{t.to_s.upcase}: #{download.send(t)}" }
f.verify_download_integrity(download)