Skip to content

Commit b63669c

Browse files
committed
download_queue: fix bottle manifest handling.
These should be ignored upon failures.
1 parent 0c09ed7 commit b63669c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Library/Homebrew/download_queue.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def fetch
3838
rescue ChecksumMismatchError => e
3939
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
4040
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
41+
rescue => e
42+
raise e unless bottle_manifest_error?(downloadable, e)
4143
end
4244
else
4345
spinner = Spinner.new
@@ -68,6 +70,9 @@ def fetch
6870
raise future.state.to_s
6971
end
7072

73+
exception = future.reason if future.rejected?
74+
next 1 if bottle_manifest_error?(downloadable, exception)
75+
7176
message = "#{downloadable.download_type} #{downloadable.name}"
7277
if tty
7378
stdout_print_and_flush "#{status} #{message}#{"\n" unless last}"
@@ -76,14 +81,13 @@ def fetch
7681
end
7782

7883
if future.rejected?
79-
if (e = future.reason).is_a?(ChecksumMismatchError)
80-
opoo "#{downloadable.download_type} reports different checksum: #{e.expected}"
84+
if exception.is_a?(ChecksumMismatchError)
85+
opoo "#{downloadable.download_type} reports different checksum: #{exception.expected}"
8186
Homebrew.failed = true if downloadable.is_a?(Resource::Patch)
8287
next 2
8388
else
8489
message = future.reason.to_s
85-
onoe message
86-
Homebrew.failed = true
90+
ofail message
8791
next message.count("\n")
8892
end
8993
end
@@ -165,6 +169,13 @@ def shutdown
165169

166170
private
167171

172+
sig { params(downloadable: Downloadable, exception: T.nilable(Exception)).returns(T::Boolean) }
173+
def bottle_manifest_error?(downloadable, exception)
174+
return false if exception.nil?
175+
176+
downloadable.is_a?(Resource::BottleManifest) || exception.is_a?(Resource::BottleManifest::Error)
177+
end
178+
168179
sig { void }
169180
def cancel
170181
# FIXME: Implement graceful cancellation of running downloads based on

0 commit comments

Comments
 (0)