Let GitDownloadStrategy report its cache location.
This commit is contained in:
parent
48a5f6ca79
commit
38d969ea7c
@ -41,6 +41,10 @@ class CurlDownloadStrategy <AbstractDownloadStrategy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cached_location
|
||||||
|
@tarball_path
|
||||||
|
end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
ohai "Downloading #{@url}"
|
ohai "Downloading #{@url}"
|
||||||
unless @tarball_path.exist?
|
unless @tarball_path.exist?
|
||||||
@ -147,9 +151,17 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
class GitDownloadStrategy <AbstractDownloadStrategy
|
class GitDownloadStrategy <AbstractDownloadStrategy
|
||||||
|
def initialize url, name, version, specs
|
||||||
|
super
|
||||||
|
@clone=HOMEBREW_CACHE+@unique_token
|
||||||
|
end
|
||||||
|
|
||||||
|
def cached_location
|
||||||
|
@clone
|
||||||
|
end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
ohai "Cloning #{@url}"
|
ohai "Cloning #{@url}"
|
||||||
@clone=HOMEBREW_CACHE+@unique_token
|
|
||||||
unless @clone.exist?
|
unless @clone.exist?
|
||||||
safe_system 'git', 'clone', @url, @clone # indeed, leave it verbose
|
safe_system 'git', 'clone', @url, @clone # indeed, leave it verbose
|
||||||
else
|
else
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
def cached_download
|
def cached_download
|
||||||
@downloader.tarball_path
|
@downloader.cached_location
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_reader :url, :version, :homepage, :name, :specs
|
attr_reader :url, :version, :homepage, :name, :specs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user