Fix wrong stage
method being called.
This commit is contained in:
parent
231ac720d2
commit
fb0bf3b7a2
@ -710,6 +710,17 @@ class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Strategy for extracting local binary packages.
|
||||||
|
class LocalBottleDownloadStrategy < AbstractFileDownloadStrategy
|
||||||
|
def initialize(path) # rubocop:disable Lint/MissingSuper
|
||||||
|
@cached_location = path
|
||||||
|
end
|
||||||
|
|
||||||
|
def clear_cache
|
||||||
|
# Path is used directly and not cached.
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Strategy for downloading a Subversion repository.
|
# Strategy for downloading a Subversion repository.
|
||||||
#
|
#
|
||||||
# @api public
|
# @api public
|
||||||
|
@ -1254,12 +1254,12 @@ on_request: installed_on_request?, options:)
|
|||||||
formula.fetch_patches
|
formula.fetch_patches
|
||||||
formula.resources.each(&:fetch)
|
formula.resources.each(&:fetch)
|
||||||
end
|
end
|
||||||
downloader.fetch
|
downloadable.downloader.fetch
|
||||||
|
|
||||||
self.class.fetched << formula
|
self.class.fetched << formula
|
||||||
end
|
end
|
||||||
|
|
||||||
def downloader
|
def downloadable
|
||||||
if (bottle_path = formula.local_bottle_path)
|
if (bottle_path = formula.local_bottle_path)
|
||||||
Resource::Local.new(bottle_path)
|
Resource::Local.new(bottle_path)
|
||||||
elsif pour_bottle?
|
elsif pour_bottle?
|
||||||
@ -1324,7 +1324,7 @@ on_request: installed_on_request?, options:)
|
|||||||
end
|
end
|
||||||
|
|
||||||
HOMEBREW_CELLAR.cd do
|
HOMEBREW_CELLAR.cd do
|
||||||
downloader.stage
|
downloadable.downloader.stage
|
||||||
end
|
end
|
||||||
|
|
||||||
Tab.clear_cache
|
Tab.clear_cache
|
||||||
|
@ -273,26 +273,7 @@ class Resource
|
|||||||
class Local < Resource
|
class Local < Resource
|
||||||
def initialize(path)
|
def initialize(path)
|
||||||
super(File.basename(path))
|
super(File.basename(path))
|
||||||
@path = path
|
@downloader = LocalBottleDownloadStrategy.new(path)
|
||||||
end
|
|
||||||
|
|
||||||
sig { override.returns(Pathname) }
|
|
||||||
def cached_download
|
|
||||||
@path
|
|
||||||
end
|
|
||||||
|
|
||||||
sig { override.void }
|
|
||||||
def clear_cache; end
|
|
||||||
|
|
||||||
sig {
|
|
||||||
override.params(
|
|
||||||
verify_download_integrity: T::Boolean,
|
|
||||||
timeout: T.nilable(T.any(Integer, Float)),
|
|
||||||
quiet: T::Boolean,
|
|
||||||
).returns(Pathname)
|
|
||||||
}
|
|
||||||
def fetch(verify_download_integrity: true, timeout: nil, quiet: false)
|
|
||||||
cached_download
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ class Bottle
|
|||||||
attr_reader :name, :resource, :tag, :cellar, :rebuild
|
attr_reader :name, :resource, :tag, :cellar, :rebuild
|
||||||
|
|
||||||
def_delegators :resource, :url, :verify_download_integrity
|
def_delegators :resource, :url, :verify_download_integrity
|
||||||
def_delegators :resource, :cached_download
|
def_delegators :resource, :cached_download, :downloader
|
||||||
|
|
||||||
def initialize(formula, spec, tag = nil)
|
def initialize(formula, spec, tag = nil)
|
||||||
super()
|
super()
|
||||||
@ -408,9 +408,7 @@ class Bottle
|
|||||||
@spec.skip_relocation?(tag: @tag)
|
@spec.skip_relocation?(tag: @tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
def stage
|
def stage = downloader.stage
|
||||||
resource.downloader.stage
|
|
||||||
end
|
|
||||||
|
|
||||||
def fetch_tab(timeout: nil, quiet: false)
|
def fetch_tab(timeout: nil, quiet: false)
|
||||||
return unless (resource = github_packages_manifest_resource)
|
return unless (resource = github_packages_manifest_resource)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user