Revert diagnostic change.

This commit is contained in:
Markus Reiter 2024-02-08 21:13:49 +01:00
parent d70f719411
commit ecee4aed35
No known key found for this signature in database
GPG Key ID: 245293B51702655B
2 changed files with 20 additions and 1 deletions

View File

@ -835,7 +835,14 @@ module Homebrew
kegs = Keg.all kegs = Keg.all
deleted_formulae = kegs.map do |keg| deleted_formulae = kegs.map do |keg|
next if Formulary::FromNameLoader.try_new(keg.name, warn: false).nil? next if Formulary.tap_paths(keg.name).any?
unless EnvConfig.no_install_from_api?
# Formulae installed from the 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.blank? || tap.core_tap?) && Homebrew::API::Formula.all_formulae.key?(keg.name)
end
keg.name keg.name
end.compact.uniq end.compact.uniq

View File

@ -1172,6 +1172,18 @@ module Formulary
find_formula_in_tap(name.to_s.downcase, CoreTap.instance) find_formula_in_tap(name.to_s.downcase, CoreTap.instance)
end end
def self.tap_paths(name)
name = name.to_s.downcase
Tap.map do |tap|
formula_path = find_formula_in_tap(name, tap)
alias_path = tap.alias_dir/name
next alias_path if !formula_path.exist? && alias_path.exist?
formula_path
end.select(&:file?)
end
sig { params(name: String, tap: Tap).returns(Pathname) } sig { params(name: String, tap: Tap).returns(Pathname) }
def self.find_formula_in_tap(name, tap) def self.find_formula_in_tap(name, tap)
filename = if name.end_with?(".rb") filename = if name.end_with?(".rb")