diff options
| author | Adam Vandenberg | 2010-05-05 21:16:32 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-05-05 21:20:11 -0700 |
| commit | 38d969ea7c40120b5e9f354af132b113df4ba2aa (patch) | |
| tree | 2973829d71659154fd02b63045f6284cd1c837bc /Library | |
| parent | 48a5f6ca7910d63ced0d51efc06787a923b6562b (diff) | |
| download | brew-38d969ea7c40120b5e9f354af132b113df4ba2aa.tar.bz2 | |
Let GitDownloadStrategy report its cache location.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 14 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index ac323d55b..c1b1f09ee 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -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 diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 639a9bef8..1827cc263 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -116,7 +116,7 @@ class Formula end def cached_download - @downloader.tarball_path + @downloader.cached_location end attr_reader :url, :version, :homepage, :name, :specs |
