Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

missing: ignore unused optional and recommended deps

  • Loading branch information...
commit a063cad9ea6502b94305ce62fceaf7da7ceab20c 1 parent f6d54c0
@jacknagel authored
Showing with 13 additions and 13 deletions.
  1. +1 −1  Library/Homebrew/cmd/doctor.rb
  2. +12 −12 Library/Homebrew/cmd/missing.rb
View
2  Library/Homebrew/cmd/doctor.rb
@@ -872,7 +872,7 @@ def check_tmpdir
def check_missing_deps
return unless HOMEBREW_CELLAR.exist?
s = Set.new
- Homebrew.missing_deps(Homebrew.installed_brews).each do |_, deps|
+ Homebrew.missing_deps(Formula.installed).each do |_, deps|
s.merge deps
end
View
24 Library/Homebrew/cmd/missing.rb
@@ -1,21 +1,21 @@
require 'formula'
+require 'tab'
module Homebrew extend self
- def installed_brews
- formulae = []
- HOMEBREW_CELLAR.subdirs.each do |rack|
- f = Formula.factory rack.basename.to_s rescue nil
- formulae << f if f and f.rack.exist? and f.rack.subdirs.length > 0
- end
- formulae
- end
-
def missing_deps ff
missing = {}
ff.each do |f|
- missing_deps = f.recursive_deps.uniq.reject do |dep|
- dep.rack.exist? and dep.rack.subdirs.length > 0
+ missing_deps = f.recursive_dependencies do |dependent, dep|
+ if dep.optional? || dep.recommended?
+ tab = Tab.for_formula(dependent)
+ Dependency.prune unless tab.with?(dep.name)
+ elsif dep.build?
+ Dependency.prune
end
+ end
+
+ missing_deps.map!(&:to_formula)
+ missing_deps.reject! { |d| d.rack.exist? && d.rack.subdirs.length > 0 }
unless missing_deps.empty?
yield f.name, missing_deps if block_given?
@@ -29,7 +29,7 @@ def missing
return unless HOMEBREW_CELLAR.exist?
ff = if ARGV.named.empty?
- installed_brews
+ Formula.installed
else
ARGV.formulae
end
Please sign in to comment.
Something went wrong with that request. Please try again.