Let GitDownloadStrategy report its cache location.

This commit is contained in:
Adam Vandenberg 2010-05-05 21:16:32 -07:00
parent 48a5f6ca79
commit 38d969ea7c
2 changed files with 14 additions and 2 deletions

View File

@ -41,6 +41,10 @@ class CurlDownloadStrategy <AbstractDownloadStrategy
end
end
def cached_location
@tarball_path
end
def fetch
ohai "Downloading #{@url}"
unless @tarball_path.exist?
@ -147,9 +151,17 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
end
class GitDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@clone=HOMEBREW_CACHE+@unique_token
end
def cached_location
@clone
end
def fetch
ohai "Cloning #{@url}"
@clone=HOMEBREW_CACHE+@unique_token
unless @clone.exist?
safe_system 'git', 'clone', @url, @clone # indeed, leave it verbose
else

View File

@ -116,7 +116,7 @@ class Formula
end
def cached_download
@downloader.tarball_path
@downloader.cached_location
end
attr_reader :url, :version, :homepage, :name, :specs