From 408e15f485149c99fcfab4e8611aad3e51d47c1a Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Thu, 12 Oct 2023 16:59:10 +0100 Subject: [PATCH] formulary: load from API for formula renames --- Library/Homebrew/formulary.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index f2e0d5137b..f629707827 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -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