aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Contributions/examples/brew-missing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Contributions/examples/brew-missing.rb')
-rwxr-xr-xLibrary/Contributions/examples/brew-missing.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/Library/Contributions/examples/brew-missing.rb b/Library/Contributions/examples/brew-missing.rb
index 68206278c..701bb1ca2 100755
--- a/Library/Contributions/examples/brew-missing.rb
+++ b/Library/Contributions/examples/brew-missing.rb
@@ -1,21 +1,18 @@
require "formula"
-require 'formula_installer'
+require "cmd/outdated"
def main
# Names of outdated brews; they count as installed.
- outdated = outdated_brews.collect {|b| b[1]}
+ outdated = Homebrew.outdated_brews.collect{ |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.reject do |dep_name|
+ HOMEBREW_CELLAR.subdirs.each do |rack|
+ f = Formula.factory rack.basename.to_s rescue nil
+ if f and f.installed?
+ missing_deps = f.recursive_deps.map{ |g| g.name }.uniq.reject do |dep_name|
Formula.factory(dep_name).installed? or outdated.include?(dep_name)
end
- puts "#{f.name}: #{missing_deps.join(', ')}" unless missing_deps.empty?
+ puts "#{f.name}: #{missing_deps * ', '}" unless missing_deps.empty?
end
end
end