Skip to content

Commit

Permalink
Merge pull request #11005 from MikeMcQuaid/github_packages_bottle_tab…
Browse files Browse the repository at this point in the history
…_clear_cache

Fix `brew fetch --force` for GitHub Packages bottle tab download.
  • Loading branch information
MikeMcQuaid committed Apr 2, 2021
2 parents 3e0f140 + 262f964 commit f266acf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Library/Homebrew/cmd/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def fetch
fetched_bottle = false
if fetch_bottle?(f, args: args)
begin
f.clear_cache if args.force?
f.fetch_bottle_tab
fetch_formula(f.bottle, args: args)
rescue Interrupt
Expand Down
7 changes: 6 additions & 1 deletion Library/Homebrew/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def extname
attr_reader :name, :resource, :prefix, :cellar, :rebuild

def_delegators :resource, :url, :verify_download_integrity
def_delegators :resource, :cached_download, :clear_cache
def_delegators :resource, :cached_download

def initialize(formula, spec)
@name = formula.name
Expand Down Expand Up @@ -335,6 +335,11 @@ def fetch(verify_download_integrity: true)
@resource.fetch(verify_download_integrity: verify_download_integrity)
end

def clear_cache
@resource.clear_cache
github_packages_manifest_resource&.clear_cache
end

def compatible_locations?
@spec.compatible_locations?
end
Expand Down

0 comments on commit f266acf

Please sign in to comment.