formulary: respect HOMEBREW_BOTTLE_DOMAIN when installing from API

This commit is contained in:
Xuehai Pan 2023-02-07 12:12:00 +00:00
parent 8fdf6aca11
commit 176637acd8

View File

@ -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"]