aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dependency.rb
diff options
context:
space:
mode:
authorJack Nagel2013-07-22 21:36:11 -0500
committerJack Nagel2013-07-22 21:36:11 -0500
commitfcfc53df3314136cd8298e8971ea41d7402b7064 (patch)
treec4f482f14b3eab5e49bce874301b20ecf7c01051 /Library/Homebrew/dependency.rb
parent1fb4cd501b58aeba30dbf903a496d1606da27868 (diff)
downloadbrew-fcfc53df3314136cd8298e8971ea41d7402b7064.tar.bz2
Check deps of satisfied deps
Diffstat (limited to 'Library/Homebrew/dependency.rb')
-rw-r--r--Library/Homebrew/dependency.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb
index 407623810..c63e26f3f 100644
--- a/Library/Homebrew/dependency.rb
+++ b/Library/Homebrew/dependency.rb
@@ -71,8 +71,11 @@ class Dependency
# optionals and recommendeds based on what the dependent has asked for.
def expand(dependent, &block)
deps = dependent.deps.map do |dep|
- if prune?(dependent, dep, &block)
+ case action(dependent, dep, &block)
+ when :prune
next
+ when :skip
+ expand(dep.to_formula, &block)
else
expand(dep.to_formula, &block) << dep
end
@@ -81,8 +84,8 @@ class Dependency
merge_repeats(deps)
end
- def prune?(dependent, dep, &block)
- catch(:prune) do
+ def action(dependent, dep, &block)
+ catch(:action) do
if block_given?
yield dependent, dep
elsif dep.optional? || dep.recommended?
@@ -93,7 +96,11 @@ class Dependency
# Used to prune dependencies when calling expand with a block.
def prune
- throw(:prune, true)
+ throw(:action, :prune)
+ end
+
+ def skip
+ throw(:action, :skip)
end
def merge_repeats(deps)