formulary: load from API for formula renames

This commit is contained in:
Bo Anderson 2023-10-12 16:59:10 +01:00
parent fac3e99503
commit 408e15f485
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -149,6 +149,8 @@ module Formulary
class_name = class_s(name)
json_formula = Homebrew::API::Formula.all_formulae[name]
raise FormulaUnavailableError, name if json_formula.nil?
json_formula = Homebrew::API.merge_variations(json_formula)
uses_from_macos_names = json_formula["uses_from_macos"].map do |dep|
@ -963,6 +965,10 @@ module Formulary
end
if CoreTap.instance.formula_renames.key?(ref)
unless Homebrew::EnvConfig.no_install_from_api?
return FormulaAPILoader.new(CoreTap.instance.formula_renames[ref])
end
return TapLoader.new("#{CoreTap.instance}/#{ref}", from: from, warn: warn)
end