From 176637acd8015572c64c9cd47d6f33d3b8ba11b3 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Tue, 7 Feb 2023 12:12:00 +0000 Subject: [PATCH] formulary: respect `HOMEBREW_BOTTLE_DOMAIN` when installing from API --- Library/Homebrew/formulary.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index cf53563a45..f26508069e 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -169,7 +169,12 @@ module Formulary if (bottles_stable = json_formula["bottle"]["stable"]).present? bottle do - root_url bottles_stable["root_url"] + if Homebrew::EnvConfig.bottle_domain != HOMEBREW_BOTTLE_DEFAULT_DOMAIN \ + && bottles_stable["root_url"] == HOMEBREW_BOTTLE_DEFAULT_DOMAIN + root_url Homebrew::EnvConfig.bottle_domain + else + root_url bottles_stable["root_url"] + end rebuild bottles_stable["rebuild"] bottles_stable["files"].each do |tag, bottle_spec| cellar = Formulary.convert_to_string_or_symbol bottle_spec["cellar"]