diff options
| -rw-r--r-- | Library/Homebrew/cmd/fetch.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index f075bcdce..8af5ff7ca 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -16,14 +16,36 @@ module Homebrew extend self end puts "Fetching: #{bucket * ', '}" if bucket.size > 1 - bucket.each { |f| fetch_formula(f) } + bucket.each do |f| + fetch_formula(f) + f.resources.each do |r| + fetch_resource(r) + end + end end def already_fetched? f f.cached_download.exist? end + def fetch_resource r + puts "Resource: #{r.name}" + fetch_fetchable r + rescue ChecksumMismatchError => e + Homebrew.failed = true + opoo "Resource #{r.name} reports different #{e.hash_type}: #{e.expected}" + end + def fetch_formula f + fetch_fetchable f + rescue ChecksumMismatchError => e + Homebrew.failed = true + opoo "Formula reports different #{e.hash_type}: #{e.expected}" + end + + private + + def fetch_fetchable f f.cached_download.rmtree if already_fetched?(f) && ARGV.force? download = f.fetch @@ -33,8 +55,5 @@ module Homebrew extend self puts Checksum::TYPES.map { |t| "#{t.to_s.upcase}: #{download.send(t)}" } f.verify_download_integrity(download) - rescue ChecksumMismatchError => e - Homebrew.failed = true - opoo "Formula reports different #{e.hash_type}: #{e.expected}" end end |
