Merge pull request #2252 from zmwangx/audit-no-warn-brew-mirror-url
audit: do not warn about reachability of `brew mirror`ed URL
This commit is contained in:
commit
c4c3588de8
@ -1565,6 +1565,9 @@ class ResourceAuditor
|
||||
|
||||
strategy = DownloadStrategyDetector.detect(url, using)
|
||||
if strategy <= CurlDownloadStrategy && !url.start_with?("file")
|
||||
# A `brew mirror`'ed URL is usually not yet reachable at the time of
|
||||
# pull request.
|
||||
next if url =~ %r{^https://dl.bintray.com/homebrew/mirror/}
|
||||
if http_content_problem = FormulaAuditor.check_http_content(url)
|
||||
problem http_content_problem
|
||||
end
|
||||
|
||||
@ -155,6 +155,13 @@ module Homebrew
|
||||
next
|
||||
end
|
||||
|
||||
if f.stable
|
||||
stable_urls = [f.stable.url] + f.stable.mirrors
|
||||
stable_urls.grep(%r{^https://dl.bintray.com/homebrew/mirror/}) do |mirror_url|
|
||||
check_bintray_mirror(f.full_name, mirror_url)
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV.include? "--bottle"
|
||||
if f.bottle_unneeded?
|
||||
ohai "#{f}: skipping unneeded bottle."
|
||||
@ -588,4 +595,12 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_bintray_mirror(name, url)
|
||||
headers = curl_output("--connect-timeout", "15", "--head", url)[0]
|
||||
status_code = headers.scan(%r{^HTTP\/.* (\d+)}).last.first
|
||||
return if status_code.start_with?("3")
|
||||
opoo "The Bintray mirror #{url} is not reachable (HTTP status code #{status_code})."
|
||||
opoo "Do you need to upload it with `brew mirror #{name}`?"
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user