diff options
| author | Misty De Meo | 2011-09-06 19:57:00 -0500 |
|---|---|---|
| committer | Adam Vandenberg | 2011-10-22 08:04:26 -0700 |
| commit | ea644dded37346903e13d3b80e6362f92e4645a4 (patch) | |
| tree | eda89c89cab7dc2912f3e7927b62ef65591b8ded /Library | |
| parent | e94a7a784e683b6695d71f96b698253466cc9d90 (diff) | |
| download | homebrew-ea644dded37346903e13d3b80e6362f92e4645a4.tar.bz2 | |
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 <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 8b6f95525..2dffccea5 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 |
