diff options
| author | Mike McQuaid | 2015-12-14 19:47:19 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2015-12-15 08:37:16 +0000 |
| commit | e5ba31fcdcc4150e5aa8ecf110cfa502dd62a802 (patch) | |
| tree | f8075f55b40693a89eec8a5b6e0fe3409f8df64a /Library/Homebrew/tab.rb | |
| parent | 484c70d19ff17944e4926e7ad3f9bc0fad98797a (diff) | |
| download | brew-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/tab.rb')
| -rw-r--r-- | Library/Homebrew/tab.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 984b587ff..975e2a610 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -147,12 +147,15 @@ class Tab < OpenStruct end def with?(val) - name = val.respond_to?(:option_name) ? val.option_name : val - include?("with-#{name}") || unused_options.include?("without-#{name}") + option_names = val.respond_to?(:option_names) ? val.option_names : [val] + + option_names.any? do |name| + include?("with-#{name}") || unused_options.include?("without-#{name}") + end end - def without?(name) - !with? name + def without?(val) + !with?(val) end def include?(opt) |
