From 83073c3ee61f3c9fc2515162714e73b02dd95378 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 31 Oct 2021 04:11:02 -0400 Subject: [PATCH 1/2] 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? From 6bd507d472a189d317b39fbf63986d3d0ab4455f Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Sun, 31 Oct 2021 15:43:13 -0400 Subject: [PATCH 2/2] Cleanup conditional Co-authored-by: Bo Anderson --- Library/Homebrew/diagnostic.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index d2cd19aed5..702a91e617 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -890,8 +890,7 @@ module Homebrew # 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) + next if (tap.blank? || tap.core_tap?) && Homebrew::API::Bottle.available?(keg.name) end keg.name