Skip to content

download_queue: fix patch handling. #20353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions Library/Homebrew/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ def files(*files)
verify_download_integrity: T::Boolean,
timeout: T.nilable(T.any(Integer, Float)),
quiet: T::Boolean,
skip_patches: T::Boolean,
).returns(Pathname)
}
def fetch(verify_download_integrity: true, timeout: nil, quiet: false)
fetch_patches
def fetch(verify_download_integrity: true, timeout: nil, quiet: false, skip_patches: false)
fetch_patches unless skip_patches

super
super(verify_download_integrity:, timeout:, quiet:)
end

# {Livecheck} can be used to check for newer versions of the software.
Expand Down Expand Up @@ -345,6 +346,9 @@ def installed_size
sig { override.returns(String) }
def download_type = "Bottle Manifest"

sig { override.returns(String) }
def name = bottle.name

private

def manifest_annotations
Expand Down Expand Up @@ -400,6 +404,15 @@ def directory(val = nil)

sig { override.returns(String) }
def download_type = "Patch"

sig { override.returns(String) }
def name
if (url = self.url)
url.to_s.split("/").last
else
super
end
end
end
end

Expand Down
6 changes: 5 additions & 1 deletion Library/Homebrew/retryable_download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ def fetch(verify_download_integrity: true, timeout: nil, quiet: false)

already_downloaded = downloadable.downloaded?

download = downloadable.fetch(verify_download_integrity: false, timeout:, quiet:)
download = if downloadable.is_a?(Resource) && (resource = T.cast(downloadable, Resource))
resource.fetch(verify_download_integrity: false, timeout:, quiet:, skip_patches: true)
else
downloadable.fetch(verify_download_integrity: false, timeout:, quiet:)
end

return download unless download.file?

Expand Down
Loading