aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-08-15 15:11:09 -0700
committerAdam Vandenberg2010-08-15 15:11:09 -0700
commitb877bc52d008f3e67735cf97cb6c1f7695f103a7 (patch)
tree7d83aebf801062102f95983eba461e2973f7daa6 /Library
parent42129a7a94808c432100d724e4b07139f47b1e6e (diff)
downloadbrew-b877bc52d008f3e67735cf97cb6c1f7695f103a7.tar.bz2
External command "brew missing"
This will print installed brews that are missing deps.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-missing.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/Library/Contributions/examples/brew-missing.rb b/Library/Contributions/examples/brew-missing.rb
new file mode 100755
index 000000000..980597ced
--- /dev/null
+++ b/Library/Contributions/examples/brew-missing.rb
@@ -0,0 +1,26 @@
+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()