Fix brew fetch --force for GitHub Packages bottle tab download.

Have to implement some custom logic here as there's two resources rather
than one.
This commit is contained in:
Mike McQuaid 2021-04-02 12:44:07 +01:00
parent a7d253a8a7
commit 262f964f9e
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
2 changed files with 7 additions and 1 deletions

View File

@ -88,6 +88,7 @@ module Homebrew
fetched_bottle = false fetched_bottle = false
if fetch_bottle?(f, args: args) if fetch_bottle?(f, args: args)
begin begin
f.clear_cache if args.force?
f.fetch_bottle_tab f.fetch_bottle_tab
fetch_formula(f.bottle, args: args) fetch_formula(f.bottle, args: args)
rescue Interrupt rescue Interrupt

View File

@ -293,7 +293,7 @@ class Bottle
attr_reader :name, :resource, :prefix, :cellar, :rebuild attr_reader :name, :resource, :prefix, :cellar, :rebuild
def_delegators :resource, :url, :verify_download_integrity def_delegators :resource, :url, :verify_download_integrity
def_delegators :resource, :cached_download, :clear_cache def_delegators :resource, :cached_download
def initialize(formula, spec) def initialize(formula, spec)
@name = formula.name @name = formula.name
@ -335,6 +335,11 @@ class Bottle
@resource.fetch(verify_download_integrity: verify_download_integrity) @resource.fetch(verify_download_integrity: verify_download_integrity)
end end
def clear_cache
@resource.clear_cache
github_packages_manifest_resource&.clear_cache
end
def compatible_locations? def compatible_locations?
@spec.compatible_locations? @spec.compatible_locations?
end end