Skip to content

Commit

Permalink
bump: resume checking for TLS 1.3 support
Browse files Browse the repository at this point in the history
macOS 12.3's shipping curl now supports TLS 1.3.
  • Loading branch information
EricFromCanada committed Apr 12, 2022
1 parent 23cf66d commit 415f05c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ def bump

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?
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/utils/repology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def query_api(last_package_in_response = "", repository:)
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?
Expand All @@ -35,7 +35,7 @@ def single_package_query(name, repository:)
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 }
Expand Down

0 comments on commit 415f05c

Please sign in to comment.