diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 53b72b9428..8ea009c007 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -823,6 +823,7 @@ class FormulaInstaller if formula.name == "curl" && !DevelopmentTools.curl_handles_most_https_certificates? ENV["HOMEBREW_CURL"] = formula.opt_bin/"curl" + Utils::Curl.clear_path_cache end caveats diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index d073166ac4..254af085a9 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -203,6 +203,7 @@ RSpec.configure do |config| FormulaInstaller.clear_attempted FormulaInstaller.clear_installed FormulaInstaller.clear_fetched + Utils::Curl.clear_path_cache TEST_DIRECTORIES.each(&:mkpath) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 5b094f7f07..0abfd0abb6 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -42,6 +42,10 @@ module Utils @curl_path ||= Utils.popen_read(curl_executable, "--homebrew=print-path").chomp.presence end + def clear_path_cache + @curl_path = nil + end + sig { params( extra_args: T.untyped,