aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDave Bayer2011-08-21 04:55:40 -0700
committerMax Howell2011-09-01 14:03:01 +0100
commit60e2fad5bb4e3bcf6cf9c1f240ed95d42c30d30a (patch)
tree8d9525b9d66d8e903c0112e61b5f08bec0542ec2 /Library
parent7fe2ee83820a9d8dc2bb51e2c3a00a94d57c9772 (diff)
downloadhomebrew-60e2fad5bb4e3bcf6cf9c1f240ed95d42c30d30a.tar.bz2
fix: svn update doesn't take url argument
`svn up` doesn't take url argument; compare `svn help up` to `svn help checkout` Apparently `svn up` can ignore this argument (not documented), but providing this argument could confuse code readers into believing that changing the url will switch the branch. It doesn't; the argument is ignored. This fix was relayed to me, but I've studied it further before posting. It is related to the bug where --HEAD installs reuse the wrong cache. Reading the former code, one might hope that providing a changed URL would have `svn up` change branches. It doesn't; the url was ignored. Closes #7159. Signed-off-by: Max Howell <max@methylblue.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 17b72efd3..cfdaaa7be 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -195,7 +195,7 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
def initialize url, name, version, specs
super
@unique_token="#{name}--svn" unless name.to_s.empty? or name == '__UNKNOWN__'
- @unique_token += "--HEAD" if ARGV.include? '--HEAD'
+ @unique_token += "-HEAD" if ARGV.include? '--HEAD'
@co=HOMEBREW_CACHE+@unique_token
end
@@ -238,16 +238,14 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
end
end
- def _fetch_command svncommand, url, target
- [svn, svncommand, '--force', url, target]
- end
-
def fetch_repo target, url, revision=nil, ignore_externals=false
# Use "svn up" when the repository already exists locally.
# This saves on bandwidth and will have a similar effect to verifying the
# cache as it will make any changes to get the right revision.
svncommand = target.exist? ? 'up' : 'checkout'
- args = _fetch_command svncommand, url, target
+ args = [svn, svncommand, '--force']
+ args << url if !target.exist?
+ args << target
args << '-r' << revision if revision
args << '--ignore-externals' if ignore_externals
quiet_safe_system(*args)