Merge pull request #14544 from XuehaiPan/api-bottle-domain

formulary: respect `HOMEBREW_BOTTLE_DOMAIN` when installing from API
This commit is contained in:
Mike McQuaid 2023-02-07 14:53:17 +01:00 committed by GitHub
commit 66fe57edb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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