From 01dc112b607d2c4707c8835be9b122109088fd75 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 6 Dec 2014 12:29:16 -0500 Subject: [PATCH] Move SVN URL munging to initialize --- Library/Homebrew/download_strategy.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 09aaeef3d1..a8092dae00 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -362,12 +362,16 @@ class S3DownloadStrategy < CurlDownloadStrategy end class SubversionDownloadStrategy < VCSDownloadStrategy + def initialize(name, resource) + super + @url = @url.sub(/^svn\+/, "") if @url =~ %r[^svn\+http://] + end + def repo_url `svn info '#{@clone}' 2>/dev/null`.strip[/^URL: (.+)$/, 1] end def fetch - @url = @url.sub(/^svn\+/, '') if @url =~ %r[^svn\+http://] ohai "Checking out #{@url}" clear_cache unless @url.chomp("/") == repo_url or quiet_system 'svn', 'switch', @url, @clone