aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorJack Nagel2013-06-03 22:50:11 -0500
committerJack Nagel2013-06-03 22:55:28 -0500
commitb87bf885c4ad02176519e80c306070f4c4b437f6 (patch)
tree9ead11a84cdbebf7af0617d171de7fa1f1d72d2d /Library/Homebrew
parent0b4316fbd4b4039a3df7ac6073bf73e1ff637162 (diff)
downloadbrew-b87bf885c4ad02176519e80c306070f4c4b437f6.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula_installer.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index af15e3ce1..d1950ad62 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -151,17 +151,13 @@ class FormulaInstaller
def necessary_deps
ARGV.filter_for_dependencies do
f.recursive_dependencies do |dependent, dep|
- if dep.optional? || dep.recommended?
- Dependency.prune unless dependent.build.with?(dep.name)
- elsif dep.build?
- Dependency.prune if install_bottle?(dependent)
- end
-
- if f.build.universal?
- dep.universal! unless dep.build?
- end
+ dep.universal! if f.build.universal? && !dep.build?
- if dep.satisfied?
+ if (dep.optional? || dep.recommended?) && dependent.build.without?(dep.name)
+ Dependency.prune
+ elsif dep.build? && install_bottle?(dependent)
+ Dependency.prune
+ elsif dep.satisfied?
Dependency.prune
elsif dep.installed?
raise UnsatisfiedDependencyError.new(f, dep)