Merge pull request #15445 from binury/master
Add brew deps `--missing` arg
This commit is contained in:
commit
1d794cd8c2
@ -49,6 +49,8 @@ module Homebrew
|
||||
switch "--installed",
|
||||
description: "List dependencies for formulae that are currently installed. If <formula> is " \
|
||||
"specified, list only its dependencies that are currently installed."
|
||||
switch "--missing",
|
||||
description: "Show only missing dependencies."
|
||||
switch "--eval-all",
|
||||
description: "Evaluate all available formulae and casks, whether installed or not, to list " \
|
||||
"their dependencies."
|
||||
@ -64,6 +66,7 @@ module Homebrew
|
||||
description: "Treat all named arguments as casks."
|
||||
|
||||
conflicts "--tree", "--graph"
|
||||
conflicts "--installed", "--missing"
|
||||
conflicts "--installed", "--eval-all"
|
||||
conflicts "--installed", "--all"
|
||||
conflicts "--formula", "--cask"
|
||||
|
||||
@ -27,6 +27,8 @@ module Homebrew
|
||||
description: "Resolve more than one level of dependencies."
|
||||
switch "--installed",
|
||||
description: "Only list formulae and casks that are currently installed."
|
||||
switch "--missing",
|
||||
description: "Only list formulae and casks that are not currently installed."
|
||||
switch "--eval-all",
|
||||
description: "Evaluate all available formulae and casks, whether installed or not, to show " \
|
||||
"their dependents."
|
||||
@ -47,6 +49,7 @@ module Homebrew
|
||||
|
||||
conflicts "--formula", "--cask"
|
||||
conflicts "--installed", "--all"
|
||||
conflicts "--missing", "--installed"
|
||||
|
||||
named_args :formula, min: 1
|
||||
end
|
||||
|
||||
@ -30,6 +30,7 @@ module DependenciesHelpers
|
||||
end
|
||||
|
||||
ignores << "recommended?" if args.skip_recommended?
|
||||
ignores << "satisfied?" if args.missing?
|
||||
|
||||
[includes, ignores]
|
||||
end
|
||||
@ -44,6 +45,8 @@ module DependenciesHelpers
|
||||
klass.prune if ignores.include?("recommended?") || dependent.build.without?(dep)
|
||||
elsif dep.optional?
|
||||
klass.prune if includes.exclude?("optional?") && !dependent.build.with?(dep)
|
||||
elsif dep.satisfied?
|
||||
klass.prune if ignores.include?("satisfied?")
|
||||
elsif dep.build? || dep.test?
|
||||
keep = false
|
||||
keep ||= dep.test? && includes.include?("test?") && dependent == root_dependent
|
||||
|
||||
@ -48,7 +48,7 @@ class Dependency
|
||||
to_formula.latest_version_installed?
|
||||
end
|
||||
|
||||
def satisfied?(inherited_options)
|
||||
def satisfied?(inherited_options = [])
|
||||
installed? && missing_options(inherited_options).empty?
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user