Skip to content
Snippets Groups Projects
Commit b877bc52 authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

External command "brew missing"

This will print installed brews that are missing deps.
parent 42129a7a
No related branches found
No related tags found
No related merge requests found
require "formula"
require 'formula_installer'
def main
# Names of outdated brews; they count as installed.
outdated = outdated_brews.select {|b| b[1] }
HOMEBREW_CELLAR.subdirs.each do |keg|
next unless keg.subdirs
if ((f = Formula.factory(keg.basename.to_s)).installed? rescue false)
f_deps = FormulaInstaller.expand_deps(f).collect{|g| g.name}.uniq
next if f_deps.empty?
missing_deps = []
f_deps.each do |dep_name|
unless Formula.factory(dep_name).installed? or outdated.include?(dep_name)
missing_deps << dep_name
end
end
puts "#{f.name}: #{missing_deps.join(', ')}" unless missing_deps.empty?
end
end
end
main()
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