Don't version VCS checkout directories.

While tarballs are versioned to prevent conflicts when newer ones are downloaded,
we shouldn't be versioning the name of the VCS checkout when a formula uses
"HEAD" or a stable commit.

Append the name of the vcs system to the checkout path, in case a project changes
vcs providers, to prevent future conflicts.
This commit is contained in:
Adam Vandenberg 2010-07-06 08:29:02 -07:00
parent 07ce6d6e16
commit 0a018deb93

View File

@ -5,7 +5,6 @@ class AbstractDownloadStrategy
@spec = specs.keys.first # only use first spec
@ref = specs.values.first
end
@unique_token="#{name}-#{version}" unless name.to_s.empty? or name == '__UNKNOWN__'
end
def expand_safe_system_args args
@ -31,16 +30,17 @@ end
class CurlDownloadStrategy <AbstractDownloadStrategy
attr_reader :tarball_path
def initialize url, name, version, specs
super
@unique_token="#{name}-#{version}" unless name.to_s.empty? or name == '__UNKNOWN__'
if @unique_token
@tarball_path=HOMEBREW_CACHE+(@unique_token+ext)
else
@tarball_path=HOMEBREW_CACHE+File.basename(@url)
end
end
def cached_location
@tarball_path
end
@ -156,6 +156,7 @@ end
class SubversionDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--svn" unless name.to_s.empty? or name == '__UNKNOWN__'
@co=HOMEBREW_CACHE+@unique_token
end
@ -238,6 +239,7 @@ end
class GitDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--git" unless name.to_s.empty? or name == '__UNKNOWN__'
@clone=HOMEBREW_CACHE+@unique_token
end
@ -287,6 +289,7 @@ end
class CVSDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--cvs" unless name.to_s.empty? or name == '__UNKNOWN__'
@co=HOMEBREW_CACHE+@unique_token
end
@ -336,6 +339,7 @@ end
class MercurialDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--hg" unless name.to_s.empty? or name == '__UNKNOWN__'
@clone=HOMEBREW_CACHE+@unique_token
end
@ -380,6 +384,7 @@ end
class BazaarDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--bzr" unless name.to_s.empty? or name == '__UNKNOWN__'
@clone=HOMEBREW_CACHE+@unique_token
end