aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb14
-rw-r--r--Library/Homebrew/formula.rb2
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