mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Reorder download strategy regexps by frequency
This commit is contained in:
parent
aa7ed10968
commit
eace29a50e
@ -808,29 +808,30 @@ class DownloadStrategyDetector
|
|||||||
|
|
||||||
def self.detect_from_url(url)
|
def self.detect_from_url(url)
|
||||||
case url
|
case url
|
||||||
# We use a special URL pattern for cvs
|
when %r[^https?://.+\.git$], %r[^git://]
|
||||||
when %r[^cvs://] then CVSDownloadStrategy
|
GitDownloadStrategy
|
||||||
# Standard URLs
|
when %r[^http://www\.apache\.org/dyn/closer\.cgi]
|
||||||
when %r[^bzr://] then BazaarDownloadStrategy
|
CurlApacheMirrorDownloadStrategy
|
||||||
when %r[^git://] then GitDownloadStrategy
|
when %r[^https?://(.+?\.)?googlecode\.com/svn], %r[^https?://svn\.], %r[^svn://], %r[^https?://(.+?\.)?sourceforge\.net/svnroot/]
|
||||||
when %r[^https?://.+\.git$] then GitDownloadStrategy
|
SubversionDownloadStrategy
|
||||||
when %r[^hg://] then MercurialDownloadStrategy
|
when %r[^cvs://]
|
||||||
when %r[^svn://] then SubversionDownloadStrategy
|
CVSDownloadStrategy
|
||||||
when %r[^svn\+http://] then SubversionDownloadStrategy
|
when %r[^https?://(.+?\.)?googlecode\.com/hg]
|
||||||
when %r[^fossil://] then FossilDownloadStrategy
|
MercurialDownloadStrategy
|
||||||
# Some well-known source hosts
|
when %r[^hg://]
|
||||||
when %r[^https?://(.+?\.)?googlecode\.com/hg] then MercurialDownloadStrategy
|
MercurialDownloadStrategy
|
||||||
when %r[^https?://(.+?\.)?googlecode\.com/svn] then SubversionDownloadStrategy
|
when %r[^bzr://]
|
||||||
when %r[^https?://(.+?\.)?sourceforge\.net/svnroot/] then SubversionDownloadStrategy
|
BazaarDownloadStrategy
|
||||||
when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/] then MercurialDownloadStrategy
|
when %r[^fossil://]
|
||||||
when %r[^http://svn.apache.org/repos/] then SubversionDownloadStrategy
|
FossilDownloadStrategy
|
||||||
when %r[^http://www.apache.org/dyn/closer.cgi] then CurlApacheMirrorDownloadStrategy
|
when %r[^http://svn\.apache\.org/repos/], %r[^svn\+http://]
|
||||||
# Common URL patterns
|
SubversionDownloadStrategy
|
||||||
when %r[^https?://svn\.] then SubversionDownloadStrategy
|
when %r[^https?://(.+?\.)?sourceforge\.net/hgweb/]
|
||||||
|
MercurialDownloadStrategy
|
||||||
when bottle_native_regex, bottle_regex
|
when bottle_native_regex, bottle_regex
|
||||||
CurlBottleDownloadStrategy
|
CurlBottleDownloadStrategy
|
||||||
# Otherwise just try to download
|
else
|
||||||
else CurlDownloadStrategy
|
CurlDownloadStrategy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user