diff options
| author | ilovezfs | 2016-09-29 11:28:01 +0100 |
|---|---|---|
| committer | Alyssa Ross | 2016-10-25 22:34:35 +0100 |
| commit | 7fa4ffe3dc3dd577fa04c374cc965c1b6f303632 (patch) | |
| tree | 6ef647ec3e0e3a88a38ba316f05b821436d23515 | |
| parent | ed0fffd93117a5d2d0297c5965d661e2e7e250de (diff) | |
| download | brew-7fa4ffe3dc3dd577fa04c374cc965c1b6f303632.tar.bz2 | |
missing: allow hiding specified formulae
| -rw-r--r-- | Library/Homebrew/cmd/missing.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/missing.rb b/Library/Homebrew/cmd/missing.rb index 148fe5bef..4a9e0b7b3 100644 --- a/Library/Homebrew/cmd/missing.rb +++ b/Library/Homebrew/cmd/missing.rb @@ -18,7 +18,7 @@ module Homebrew ARGV.resolved_formulae end - Diagnostic.missing_deps(ff) do |name, missing| + Diagnostic.missing_deps(ff, ARGV.value("hide")) do |name, missing| print "#{name}: " if ff.size > 1 puts missing.join(" ") end diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 6f53bf0e1..0031811c5 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -7,7 +7,7 @@ require "utils/shell" module Homebrew module Diagnostic - def self.missing_deps(ff) + def self.missing_deps(ff, hide = nil) missing = {} ff.each do |f| missing_deps = f.recursive_dependencies do |dependent, dep| @@ -20,7 +20,13 @@ module Homebrew end missing_deps.map!(&:to_formula) - missing_deps.reject! { |d| d.installed_prefixes.any? } + if hide + missing_deps.reject! do |d| + !hide.include?(d.name) && d.installed_prefixes.any? + end + else + missing_deps.reject! { |d| d.installed_prefixes.any? } + end unless missing_deps.empty? yield f.full_name, missing_deps if block_given? |
