From 415f05ca31d184cea91733eaae54fc5386c9a9f5 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Mon, 11 Apr 2022 17:57:08 -0400 Subject: [PATCH] bump: resume checking for TLS 1.3 support macOS 12.3's shipping curl now supports TLS 1.3. --- Library/Homebrew/dev-cmd/bump.rb | 12 +++++++----- Library/Homebrew/utils/repology.rb | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index 2269dc1e6f..72635110c7 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -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? diff --git a/Library/Homebrew/utils/repology.rb b/Library/Homebrew/utils/repology.rb index 9f64613e0a..0782cd1d49 100644 --- a/Library/Homebrew/utils/repology.rb +++ b/Library/Homebrew/utils/repology.rb @@ -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 }