diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 60794c7d85..93fb6ff6b9 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -66,7 +66,7 @@ module Homebrew fetched_bottle = false if fetch_bottle?(f, args: args) begin - fetch_formula(f.bottle) + fetch_formula(f.bottle, args: args) rescue Interrupt raise rescue => e @@ -82,40 +82,40 @@ module Homebrew next if fetched_bottle - fetch_formula(f) + fetch_formula(f, args: args) f.resources.each do |r| - fetch_resource(r) - r.patches.each { |p| fetch_patch(p) if p.external? } + fetch_resource(r, args: args) + r.patches.each { |p| fetch_patch(p, args: args) if p.external? } end - f.patchlist.each { |p| fetch_patch(p) if p.external? } + f.patchlist.each { |p| fetch_patch(p, args: args) if p.external? } end end - def fetch_resource(r) + def fetch_resource(r, args:) puts "Resource: #{r.name}" - fetch_fetchable r + fetch_fetchable r, args: args rescue ChecksumMismatchError => e - retry if retry_fetch? r + retry if retry_fetch?(r, args: args) opoo "Resource #{r.name} reports different #{e.hash_type}: #{e.expected}" end - def fetch_formula(f) - fetch_fetchable f + def fetch_formula(f, args:) + fetch_fetchable f, args: args rescue ChecksumMismatchError => e - retry if retry_fetch? f + retry if retry_fetch?(f, args: args) opoo "Formula reports different #{e.hash_type}: #{e.expected}" end - def fetch_patch(p) - fetch_fetchable p + def fetch_patch(p, args:) + fetch_fetchable p, args: args rescue ChecksumMismatchError => e Homebrew.failed = true opoo "Patch reports different #{e.hash_type}: #{e.expected}" end - def retry_fetch?(f) + def retry_fetch?(f, args:) @fetch_failed ||= Set.new if args.retry? && @fetch_failed.add?(f) ohai "Retrying download" @@ -127,7 +127,7 @@ module Homebrew end end - def fetch_fetchable(f) + def fetch_fetchable(f, args:) f.clear_cache if args.force? already_fetched = f.cached_download.exist? @@ -135,7 +135,7 @@ module Homebrew begin download = f.fetch(verify_download_integrity: false) rescue DownloadError - retry if retry_fetch? f + retry if retry_fetch?(f, args: args) raise end