aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-01-27 15:48:04 -0600
committerJack Nagel2013-01-28 10:35:15 -0600
commite9014c436c4dcad88389e29f2b3a769fd2a81ef8 (patch)
tree07aa8e99afccbace62eefb9a3ddda649bc0b0ed6
parent26c0524f1a7113e98c97f75a01f60cc8b18fd062 (diff)
downloadbrew-e9014c436c4dcad88389e29f2b3a769fd2a81ef8.tar.bz2
Generate options for optional and recommended requirements
-rw-r--r--Library/Homebrew/formula.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 3ceca6d91..32e25415c 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -740,8 +740,8 @@ private
end
def depends_on dep
- dependencies.add(dep)
- post_depends_on
+ d = dependencies.add(dep)
+ post_depends_on(d) unless d.nil?
end
def option name, description=nil
@@ -806,14 +806,13 @@ private
private
- def post_depends_on
- # Generate with- and without- options for optional and recommended deps
- dependencies.deps.each do |dep|
- if dep.optional? && !build.has_option?("with-#{dep.name}")
- build.add("with-#{dep.name}", "Build with #{dep.name} support")
- elsif dep.recommended? && !build.has_option?("without-#{dep.name}")
- build.add("without-#{dep.name}", "Build without #{dep.name} support")
- end
+ def post_depends_on(dep)
+ # Generate with- or without- options for optional and recommended
+ # dependencies and requirements
+ if dep.optional? && !build.has_option?("with-#{dep.name}")
+ build.add("with-#{dep.name}", "Build with #{dep.name} support")
+ elsif dep.recommended? && !build.has_option?("without-#{dep.name}")
+ build.add("without-#{dep.name}", "Build without #{dep.name} support")
end
end
end