Merge pull request #4599 from reitermarkus/download-cache-directory
Allow specifying cache directory for download strategies.
This commit is contained in:
commit
545eb91c83
@ -22,6 +22,7 @@ class AbstractDownloadStrategy
|
|||||||
@url = url
|
@url = url
|
||||||
@name = name
|
@name = name
|
||||||
@version = version
|
@version = version
|
||||||
|
@cache = meta.fetch(:cache, HOMEBREW_CACHE)
|
||||||
@meta = meta
|
@meta = meta
|
||||||
@shutup = false
|
@shutup = false
|
||||||
extend Pourable if meta[:bottle]
|
extend Pourable if meta[:bottle]
|
||||||
@ -105,7 +106,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
super
|
super
|
||||||
@ref_type, @ref = extract_ref(meta)
|
@ref_type, @ref = extract_ref(meta)
|
||||||
@revision = meta[:revision]
|
@revision = meta[:revision]
|
||||||
@cached_location = HOMEBREW_CACHE/"#{name}--#{cache_tag}"
|
@cached_location = @cache/"#{name}--#{cache_tag}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
@ -180,7 +181,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
|
|||||||
|
|
||||||
def initialize(url, name, version, **meta)
|
def initialize(url, name, version, **meta)
|
||||||
super
|
super
|
||||||
@cached_location = HOMEBREW_CACHE/"#{name}-#{version}#{ext}"
|
@cached_location = @cache/"#{name}-#{version}#{ext}"
|
||||||
@temporary_path = Pathname.new("#{cached_location}.incomplete")
|
@temporary_path = Pathname.new("#{cached_location}.incomplete")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user