Tab#with? accepts the same types as BuildOptions#with?
This commit is contained in:
parent
5247f44205
commit
285f8f77e6
@ -9,11 +9,7 @@ class BuildOptions
|
|||||||
end
|
end
|
||||||
|
|
||||||
def with? val
|
def with? val
|
||||||
if val.respond_to?(:option_name)
|
name = val.respond_to?(:option_name) ? val.option_name : val
|
||||||
name = val.option_name
|
|
||||||
else
|
|
||||||
name = val
|
|
||||||
end
|
|
||||||
|
|
||||||
if option_defined? "with-#{name}"
|
if option_defined? "with-#{name}"
|
||||||
include? "with-#{name}"
|
include? "with-#{name}"
|
||||||
|
|||||||
@ -13,7 +13,7 @@ module Homebrew
|
|||||||
|
|
||||||
f.deps.each do |dep|
|
f.deps.each do |dep|
|
||||||
if dep.optional? || dep.recommended?
|
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
|
else
|
||||||
deps << dep.to_formula.name
|
deps << dep.to_formula.name
|
||||||
end
|
end
|
||||||
|
|||||||
@ -8,7 +8,7 @@ module Homebrew
|
|||||||
missing_deps = f.recursive_dependencies do |dependent, dep|
|
missing_deps = f.recursive_dependencies do |dependent, dep|
|
||||||
if dep.optional? || dep.recommended?
|
if dep.optional? || dep.recommended?
|
||||||
tab = Tab.for_formula(dependent)
|
tab = Tab.for_formula(dependent)
|
||||||
Dependency.prune unless tab.with?(dep.name)
|
Dependency.prune unless tab.with?(dep)
|
||||||
elsif dep.build?
|
elsif dep.build?
|
||||||
Dependency.prune
|
Dependency.prune
|
||||||
end
|
end
|
||||||
|
|||||||
@ -81,7 +81,8 @@ class Tab < OpenStruct
|
|||||||
:compiler => :clang
|
:compiler => :clang
|
||||||
end
|
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}")
|
include?("with-#{name}") || unused_options.include?("without-#{name}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user