Skip to content
Snippets Groups Projects
Commit 285f8f77 authored by Jack Nagel's avatar Jack Nagel
Browse files

Tab#with? accepts the same types as BuildOptions#with?

parent 5247f442
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,7 @@ class BuildOptions
end
def with? val
if val.respond_to?(:option_name)
name = val.option_name
else
name = val
end
name = val.respond_to?(:option_name) ? val.option_name : val
if option_defined? "with-#{name}"
include? "with-#{name}"
......
......@@ -13,7 +13,7 @@ module Homebrew
f.deps.each do |dep|
if dep.optional? || dep.recommended?
deps << dep.to_formula.name if tab.with?(dep.to_formula.name)
deps << dep.to_formula.name if tab.with?(dep)
else
deps << dep.to_formula.name
end
......
......@@ -8,7 +8,7 @@ module Homebrew
missing_deps = f.recursive_dependencies do |dependent, dep|
if dep.optional? || dep.recommended?
tab = Tab.for_formula(dependent)
Dependency.prune unless tab.with?(dep.name)
Dependency.prune unless tab.with?(dep)
elsif dep.build?
Dependency.prune
end
......
......@@ -81,7 +81,8 @@ class Tab < OpenStruct
:compiler => :clang
end
def with? name
def with? val
name = val.respond_to?(:option_name) ? val.option_name : val
include?("with-#{name}") || unused_options.include?("without-#{name}")
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment