Merge pull request #13126 from EricFromCanada/bump-repology-check

bump: resume checking for TLS 1.3 support
This commit is contained in:
Mike McQuaid 2022-04-12 10:11:02 +01:00 committed by GitHub
commit 8ba4674ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View File

@ -59,12 +59,14 @@ module Homebrew
limit = args.limit.to_i if args.limit.present?
begin
unless Pathname.new(ENV["HOMEBREW_BREWED_CURL_PATH"]).exist?
ensure_formula_installed!("curl", reason: "Repology queries")
unless Utils::Curl.curl_supports_tls13?
begin
unless Pathname.new(ENV["HOMEBREW_BREWED_CURL_PATH"]).exist?
ensure_formula_installed!("curl", reason: "Repology queries")
end
rescue FormulaUnavailableError
opoo "A newer `curl` is required for Repology queries."
end
rescue FormulaUnavailableError
opoo "A newer `curl` is required for Repology queries."
end
if formulae_and_casks.present?

View File

@ -19,7 +19,7 @@ module Repology
last_package_in_response += "/" if last_package_in_response.present?
url = "https://repology.org/api/v1/projects/#{last_package_in_response}?inrepo=#{repository}&outdated=1"
output, errors, = curl_output(url.to_s, "--silent", use_homebrew_curl: false)
output, errors, = curl_output(url.to_s, "--silent", use_homebrew_curl: !curl_supports_tls13?)
JSON.parse(output)
rescue
if Homebrew::EnvConfig.developer?
@ -35,7 +35,7 @@ module Repology
url = "https://repology.org/tools/project-by?repo=#{repository}&" \
"name_type=srcname&target_page=api_v1_project&name=#{name}"
output, errors, = curl_output("--location", "--silent", url.to_s, use_homebrew_curl: true)
output, errors, = curl_output("--location", "--silent", url.to_s, use_homebrew_curl: !curl_supports_tls13?)
data = JSON.parse(output)
{ name => data }