diff options
| author | Jack Nagel | 2014-03-18 15:28:21 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-03-18 21:28:29 -0500 |
| commit | eace29a50efb75f1fc8497f0602e0454446cb56d (patch) | |
| tree | 36eb57d92aaaffef1a3bc76a0b8e60246954a837 | |
| parent | aa7ed10968508f0390fba88c3bb2f2b0e8db9415 (diff) | |
| download | brew-eace29a50efb75f1fc8497f0602e0454446cb56d.tar.bz2 | |
Reorder download strategy regexps by frequency
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index e4628511a..0a80b8344 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -808,29 +808,30 @@ class DownloadStrategyDetector def self.detect_from_url(url) case url - # We use a special URL pattern for cvs - when %r[^cvs://] then CVSDownloadStrategy - # Standard URLs - when %r[^bzr://] then BazaarDownloadStrategy - when %r[^git://] then GitDownloadStrategy - when %r[^https?://.+\.git$] then GitDownloadStrategy - when %r[^hg://] then MercurialDownloadStrategy - when %r[^svn://] then SubversionDownloadStrategy - when %r[^svn\+http://] then SubversionDownloadStrategy - when %r[^fossil://] then FossilDownloadStrategy - # Some well-known source hosts - when %r[^https?://(.+?\.)?googlecode\.com/hg] then MercurialDownloadStrategy - when %r[^https?://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy - when %r[^https?://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy - when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/] then MercurialDownloadStrategy - when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy - when %r[^http://www.apache.org/dyn/closer.cgi] then CurlApacheMirrorDownloadStrategy - # Common URL patterns - when %r[^https?://svn\.] then SubversionDownloadStrategy + when %r[^https?://.+\.git$], %r[^git://] + GitDownloadStrategy + when %r[^http://www\.apache\.org/dyn/closer\.cgi] + CurlApacheMirrorDownloadStrategy + when %r[^https?://(.+?\.)?googlecode\.com/svn], %r[^https?://svn\.], %r[^svn://], %r[^https?://(.+?\.)?sourceforge\.net/svnroot/] + SubversionDownloadStrategy + when %r[^cvs://] + CVSDownloadStrategy + when %r[^https?://(.+?\.)?googlecode\.com/hg] + MercurialDownloadStrategy + when %r[^hg://] + MercurialDownloadStrategy + when %r[^bzr://] + BazaarDownloadStrategy + when %r[^fossil://] + FossilDownloadStrategy + when %r[^http://svn\.apache\.org/repos/], %r[^svn\+http://] + SubversionDownloadStrategy + when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/] + MercurialDownloadStrategy when bottle_native_regex, bottle_regex CurlBottleDownloadStrategy - # Otherwise just try to download - else CurlDownloadStrategy + else + CurlDownloadStrategy end end |
