aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-06 15:38:46 -0700
committerAdam Vandenberg2010-06-07 10:01:15 -0700
commiteb30a8555b73836d42296735798bc026590e1213 (patch)
tree0f15117ce2fe21c4603522ab217bf7dfdb683180 /Library
parentff9c50151da9e3a096eab5ec1da51384246cf66d (diff)
downloadbrew-eb30a8555b73836d42296735798bc026590e1213.tar.bz2
Add cache location support to CVS.
This allows formulaes which use CVS to support: brew --cache [formula]
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 6f2dff81d..f4316b9fe 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -204,9 +204,15 @@ class GitDownloadStrategy <AbstractDownloadStrategy
end
class CVSDownloadStrategy <AbstractDownloadStrategy
+ def initialize url, name, version, specs
+ super
+ @co=HOMEBREW_CACHE+@unique_token
+ end
+
+ def cached_location; @co; end
+
def fetch
ohai "Checking out #{@url}"
- @co=HOMEBREW_CACHE+@unique_token
# URL of cvs cvs://:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML:gccxml
# will become:
@@ -220,14 +226,13 @@ class CVSDownloadStrategy <AbstractDownloadStrategy
safe_system '/usr/bin/cvs', '-d', url, 'checkout', '-d', @unique_token, mod
end
else
- d = HOMEBREW_CACHE+@unique_token
- puts "Updating #{d}"
- Dir.chdir(d) { safe_system '/usr/bin/cvs', 'up' }
+ puts "Updating #{@co}"
+ Dir.chdir(@co) { safe_system '/usr/bin/cvs', 'up' }
end
end
def stage
- FileUtils.cp_r(Dir[HOMEBREW_CACHE+@unique_token+"*"], Dir.pwd)
+ FileUtils.cp_r Dir[@co+"*"], Dir.pwd
require 'find'
Find.find(Dir.pwd) do |path|