download_queue: fix bottle manifest handling.
These should be ignored upon failures.
This commit is contained in:
parent
0c09ed71d4
commit
b63669c92b
@ -38,6 +38,8 @@ module Homebrew
|
|||||||
rescue ChecksumMismatchError => e
|
rescue ChecksumMismatchError => e
|
||||||
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
|
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
|
||||||
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
|
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
|
||||||
|
rescue => e
|
||||||
|
raise e unless bottle_manifest_error?(downloadable, e)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
spinner = Spinner.new
|
spinner = Spinner.new
|
||||||
@ -68,6 +70,9 @@ module Homebrew
|
|||||||
raise future.state.to_s
|
raise future.state.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
exception = future.reason if future.rejected?
|
||||||
|
next 1 if bottle_manifest_error?(downloadable, exception)
|
||||||
|
|
||||||
message = "#{downloadable.download_type} #{downloadable.name}"
|
message = "#{downloadable.download_type} #{downloadable.name}"
|
||||||
if tty
|
if tty
|
||||||
stdout_print_and_flush "#{status} #{message}#{"\n" unless last}"
|
stdout_print_and_flush "#{status} #{message}#{"\n" unless last}"
|
||||||
@ -76,14 +81,13 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if future.rejected?
|
if future.rejected?
|
||||||
if (e = future.reason).is_a?(ChecksumMismatchError)
|
if exception.is_a?(ChecksumMismatchError)
|
||||||
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
|
opoo "#{downloadable.download_type} reports different checksum: #{exception.expected}"
|
||||||
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
|
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
|
||||||
next 2
|
next 2
|
||||||
else
|
else
|
||||||
message = future.reason.to_s
|
message = future.reason.to_s
|
||||||
onoe message
|
ofail message
|
||||||
Homebrew.failed = true
|
|
||||||
next message.count("\n")
|
next message.count("\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -165,6 +169,13 @@ module Homebrew
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
sig { params(downloadable: Downloadable, exception: T.nilable(Exception)).returns(T::Boolean) }
|
||||||
|
def bottle_manifest_error?(downloadable, exception)
|
||||||
|
return false if exception.nil?
|
||||||
|
|
||||||
|
downloadable.is_a?(Resource::BottleManifest) || exception.is_a?(Resource::BottleManifest::Error)
|
||||||
|
end
|
||||||
|
|
||||||
sig { void }
|
sig { void }
|
||||||
def cancel
|
def cancel
|
||||||
# FIXME: Implement graceful cancellation of running downloads based on
|
# FIXME: Implement graceful cancellation of running downloads based on
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user