diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 7ef29695ee..1629f66d9c 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -88,6 +88,7 @@ module Homebrew 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 diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 79b0a8cc5a..5348fbd359 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -293,7 +293,7 @@ class Bottle 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 @@ -335,6 +335,11 @@ class Bottle @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