aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/software_spec.rb
diff options
context:
space:
mode:
authorMike McQuaid2015-12-14 19:47:19 +0000
committerMike McQuaid2015-12-15 08:37:16 +0000
commite5ba31fcdcc4150e5aa8ecf110cfa502dd62a802 (patch)
treef8075f55b40693a89eec8a5b6e0fe3409f8df64a /Library/Homebrew/software_spec.rb
parent484c70d19ff17944e4926e7ad3f9bc0fad98797a (diff)
downloadbrew-e5ba31fcdcc4150e5aa8ecf110cfa502dd62a802.tar.bz2
Allow multiple option_names in dep/reqs.
This means that dependencies can be merged but still maintain all their option names. Closes Homebrew/homebrew#46916. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
-rw-r--r--Library/Homebrew/software_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index 92b6b7a9c..b6ca59961 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -185,12 +185,12 @@ class SoftwareSpec
end
def add_dep_option(dep)
- name = dep.option_name
-
- if dep.optional? && !option_defined?("with-#{name}")
- options << Option.new("with-#{name}", "Build with #{name} support")
- elsif dep.recommended? && !option_defined?("without-#{name}")
- options << Option.new("without-#{name}", "Build without #{name} support")
+ dep.option_names.each do |name|
+ if dep.optional? && !option_defined?("with-#{name}")
+ options << Option.new("with-#{name}", "Build with #{name} support")
+ elsif dep.recommended? && !option_defined?("without-#{name}")
+ options << Option.new("without-#{name}", "Build without #{name} support")
+ end
end
end
end