aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-07-06 08:29:02 -0700
committerAdam Vandenberg2010-08-07 11:32:29 -0700
commit0a018deb93bdc172d9aef90b986e14d59e5305d4 (patch)
treec6ec814da5deda5ee217141e2fd3138a0d9aefc6 /Library
parent07ce6d6e1645a645477d104fff16e232b2985b63 (diff)
downloadbrew-0a018deb93bdc172d9aef90b986e14d59e5305d4.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 412b1cfe9..a15cea3c2 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -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