From 83073c3ee61f3c9fc2515162714e73b02dd95378 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 31 Oct 2021 04:11:02 -0400 Subject: [PATCH] Fix `brew doctor` with `HOMEBREW_INSTALL_FROM_API` --- Library/Homebrew/diagnostic.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 902fd8eb33..d2cd19aed5 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -884,9 +884,17 @@ module Homebrew kegs = Keg.all deleted_formulae = kegs.map do |keg| - next if !CoreTap.instance.installed? && EnvConfig.install_from_api? && Tab.for_keg(keg).tap.core_tap? + next if Formulary.tap_paths(keg.name).any? - keg.name if Formulary.tap_paths(keg.name).blank? + if !CoreTap.instance.installed? && EnvConfig.install_from_api? + # Formulae installed with HOMEBREW_INSTALL_FROM_API should not count as deleted formulae + # but may not have a tap listed in their tab + tap = Tab.for_keg(keg).tap + next if tap.present? && tap.core_tap? + next if tap.blank? && Homebrew::API::Bottle.available?(keg.name) + end + + keg.name end.compact.uniq return if deleted_formulae.blank?