aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2009-12-17 16:01:45 +0000
committerMax Howell2009-12-17 16:12:32 +0000
commita4ed7ff619eaae7a2953dfa9ca1a09cd668f4081 (patch)
treea2694a5c5a238d06e80d0fe1d68d7808949c6a11 /Library/Homebrew
parentedb046bea8e2fc859b70162bbafd2128ee9cb600 (diff)
downloadbrew-a4ed7ff619eaae7a2953dfa9ca1a09cd668f4081.tar.bz2
Update VCS caches when installing
I held off on this as I wasn't sure it made sense. Eg. if you install you'd expect it to install the same version as before? But with HEAD formula you always want the newest, that's the point. Otherwise it should be tagged/revisioned.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/download_strategy.rb21
1 files changed, 10 insertions, 11 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 1d796f673..06942cc0b 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -135,8 +135,8 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
unless @co.exist?
quiet_safe_system svn, 'checkout', @url, @co
else
- # TODO svn up?
- puts "Repository already checked out"
+ puts "Updating #{@co}"
+ quiet_safe_system svn, 'up', @co
end
end
@@ -162,8 +162,8 @@ class GitDownloadStrategy <AbstractDownloadStrategy
unless @clone.exist?
quiet_safe_system 'git', 'clone', @url, @clone
else
- # TODO git pull?
- puts "Repository already cloned to #{@clone}"
+ puts "Updating #{@clone}"
+ Dir.chdir(@clone) { quiet_safe_system 'git', 'fetch', @url }
end
end
@@ -202,8 +202,9 @@ class CVSDownloadStrategy <AbstractDownloadStrategy
safe_system '/usr/bin/cvs', '-d', url, 'checkout', '-d', @unique_token, mod
end
else
- # TODO cvs up?
- puts "Repository already checked out"
+ d = HOMEBREW_CACHE+@unique_token
+ puts "Updating #{d}"
+ Dir.chdir(d) { safe_system '/usr/bin/cvs', 'up' }
end
end
@@ -242,12 +243,10 @@ class MercurialDownloadStrategy <AbstractDownloadStrategy
url=@url.sub(%r[^hg://], '')
unless @clone.exist?
- checkout_args = []
- checkout_args << url << @clone
- safe_system 'hg', 'clone', *checkout_args
+ safe_system 'hg', 'clone', url, @clone
else
- # TODO hg pull?
- puts "Repository already cloned"
+ puts "Updating #{@clone}"
+ Dir.chdir(@clone) { safe_system 'hg', 'update' }
end
end