Skip to content
Snippets Groups Projects
Commit 24e7f55a authored by Steve Peters's avatar Steve Peters
Browse files

Create check_broken_dependents method

parent bdfaaf79
No related branches found
No related tags found
No related merge requests found
......@@ -120,11 +120,8 @@ module Homebrew
end
private_class_method :upgrade_formula
def check_installed_dependents(args:)
installed_formulae = FormulaInstaller.installed.to_a
return if installed_formulae.empty?
already_broken_dependents = CacheStoreDatabase.use(:linkage) do |db|
def check_broken_dependents(installed_formulae)
CacheStoreDatabase.use(:linkage) do |db|
installed_formulae.flat_map(&:runtime_installed_formula_dependents)
.uniq
.select do |f|
......@@ -135,6 +132,13 @@ module Homebrew
.broken_library_linkage?
end.compact
end
end
def check_installed_dependents(args:)
installed_formulae = FormulaInstaller.installed.to_a
return if installed_formulae.empty?
already_broken_dependents = check_broken_dependents(installed_formulae)
outdated_dependents =
installed_formulae.flat_map(&:runtime_installed_formula_dependents)
......@@ -180,17 +184,7 @@ module Homebrew
# Assess the dependents tree again now we've upgraded.
oh1 "Checking for dependents of upgraded formulae..." unless args.dry_run?
broken_dependents = CacheStoreDatabase.use(:linkage) do |db|
installed_formulae.flat_map(&:runtime_installed_formula_dependents)
.uniq
.select do |f|
keg = f.opt_or_installed_prefix_keg
next unless keg
LinkageChecker.new(keg, cache_db: db)
.broken_library_linkage?
end.compact
end
broken_dependents = check_broken_dependents(installed_formulae)
if broken_dependents.blank?
if args.dry_run?
ohai "No currently broken dependents found!"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment