Pass args correctly in brew fetch.

This commit is contained in:
Markus Reiter 2020-07-31 19:14:25 +02:00
parent 096377abf2
commit 0ac6939a91

View File

@ -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