FormulaInstaller: fix "optional build-time dep" edge case

An "optional build-time dep" is unlikely, but possible, and I happen to
notice this wasn't handled correctly while digging around in the deps
code over the last few days.
This commit is contained in:
Jack Nagel 2013-06-03 22:50:11 -05:00
parent 0b4316fbd4
commit b87bf885c4

View File

@ -151,17 +151,13 @@ class FormulaInstaller
def necessary_deps def necessary_deps
ARGV.filter_for_dependencies do ARGV.filter_for_dependencies do
f.recursive_dependencies do |dependent, dep| f.recursive_dependencies do |dependent, dep|
if dep.optional? || dep.recommended? dep.universal! if f.build.universal? && !dep.build?
Dependency.prune unless dependent.build.with?(dep.name)
elsif dep.build?
Dependency.prune if install_bottle?(dependent)
end
if f.build.universal? if (dep.optional? || dep.recommended?) && dependent.build.without?(dep.name)
dep.universal! unless dep.build? Dependency.prune
end elsif dep.build? && install_bottle?(dependent)
Dependency.prune
if dep.satisfied? elsif dep.satisfied?
Dependency.prune Dependency.prune
elsif dep.installed? elsif dep.installed?
raise UnsatisfiedDependencyError.new(f, dep) raise UnsatisfiedDependencyError.new(f, dep)