download_queue: fix bottle manifest handling.

These should be ignored upon failures.
This commit is contained in:
Mike McQuaid 2025-07-29 12:42:13 +01:00
parent 0c09ed71d4
commit b63669c92b
No known key found for this signature in database

View File

@ -38,6 +38,8 @@ module Homebrew
rescue ChecksumMismatchError => e
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
rescue => e
raise e unless bottle_manifest_error?(downloadable, e)
end
else
spinner = Spinner.new
@ -68,6 +70,9 @@ module Homebrew
raise future.state.to_s
end
exception = future.reason if future.rejected?
next 1 if bottle_manifest_error?(downloadable, exception)
message = "#{downloadable.download_type} #{downloadable.name}"
if tty
stdout_print_and_flush "#{status} #{message}#{"\n" unless last}"
@ -76,14 +81,13 @@ module Homebrew
end
if future.rejected?
if (e = future.reason).is_a?(ChecksumMismatchError)
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
if exception.is_a?(ChecksumMismatchError)
opoo "#{downloadable.download_type} reports different checksum: #{exception.expected}"
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
next 2
else
message = future.reason.to_s
onoe message
Homebrew.failed = true
ofail message
next message.count("\n")
end
end
@ -165,6 +169,13 @@ module Homebrew
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 }
def cancel
# FIXME: Implement graceful cancellation of running downloads based on