From 1e17a8fb0bf0e2da5fd620acdf42a01446e0713c Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Tue, 6 Sep 2011 19:57:00 -0500 Subject: [PATCH] Add UnsafeSubversionDownloadStrategy There was an UnsafeSubversionDownloadStrategy in a single formula before, but a) it broke against later changes to SubversionDownloadStrategy, and b) wasn't available to other formula. Signed-off-by: Adam Vandenberg --- Library/Homebrew/download_strategy.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 8b6f95525c..2dffccea53 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -282,6 +282,22 @@ class StrictSubversionDownloadStrategy < SubversionDownloadStrategy end end +# Download from SVN servers with invalid or self-signed certs +class UnsafeSubversionDownloadStrategy < SubversionDownloadStrategy + 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 = [svn, svncommand, '--non-interactive', '--trust-server-cert', '--force'] + args << url if !target.exist? + args << target + args << '-r' << revision if revision + args << '--ignore-externals' if ignore_externals + quiet_safe_system(*args) + end +end + class GitDownloadStrategy < AbstractDownloadStrategy def initialize url, name, version, specs super