Move cached_location up to VCSDownloadStrategy
This commit is contained in:
parent
1626282c45
commit
dd719e7ca6
@ -55,6 +55,10 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
"#{name}--#{tag}"
|
"#{name}--#{tag}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cached_location
|
||||||
|
@clone
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class CurlDownloadStrategy < AbstractDownloadStrategy
|
class CurlDownloadStrategy < AbstractDownloadStrategy
|
||||||
@ -323,10 +327,6 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_location
|
|
||||||
@clone
|
|
||||||
end
|
|
||||||
|
|
||||||
def repo_valid?
|
def repo_valid?
|
||||||
@clone.join(".svn").directory?
|
@clone.join(".svn").directory?
|
||||||
end
|
end
|
||||||
@ -430,10 +430,6 @@ class GitDownloadStrategy < VCSDownloadStrategy
|
|||||||
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("git")}")
|
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("git")}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_location
|
|
||||||
@clone
|
|
||||||
end
|
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
ohai "Cloning #@url"
|
ohai "Cloning #@url"
|
||||||
|
|
||||||
@ -577,8 +573,6 @@ class CVSDownloadStrategy < VCSDownloadStrategy
|
|||||||
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("cvs")}")
|
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("cvs")}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_location; @clone; end
|
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
ohai "Checking out #{@url}"
|
ohai "Checking out #{@url}"
|
||||||
|
|
||||||
@ -627,8 +621,6 @@ class MercurialDownloadStrategy < VCSDownloadStrategy
|
|||||||
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("hg")}")
|
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("hg")}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_location; @clone; end
|
|
||||||
|
|
||||||
def hgpath
|
def hgpath
|
||||||
# #{HOMEBREW_PREFIX}/share/python/hg is deprecated, but we levae it in for a while
|
# #{HOMEBREW_PREFIX}/share/python/hg is deprecated, but we levae it in for a while
|
||||||
@path ||= %W[
|
@path ||= %W[
|
||||||
@ -682,8 +674,6 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
|
|||||||
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("bzr")}")
|
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("bzr")}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_location; @clone; end
|
|
||||||
|
|
||||||
def bzrpath
|
def bzrpath
|
||||||
@path ||= %W[
|
@path ||= %W[
|
||||||
#{which("bzr")}
|
#{which("bzr")}
|
||||||
@ -730,8 +720,6 @@ class FossilDownloadStrategy < VCSDownloadStrategy
|
|||||||
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("fossil")}")
|
@clone = Pathname.new("#{HOMEBREW_CACHE}/#{checkout_name("fossil")}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def cached_location; @clone; end
|
|
||||||
|
|
||||||
def fossilpath
|
def fossilpath
|
||||||
@path ||= %W[
|
@path ||= %W[
|
||||||
#{which("fossil")}
|
#{which("fossil")}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user