aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2012-08-19 17:36:10 -0400
committerMax Howell2012-08-21 12:09:05 -0400
commit4e7bb6c63766b457d07641e881da32a90f3f5872 (patch)
tree05fa77540cad609d6dc8b19dcfd9b681acd65e34
parent9274f7cda1e2261e581979887ca15ba41fef6bd9 (diff)
downloadbrew-4e7bb6c63766b457d07641e881da32a90f3f5872.tar.bz2
Better message if multiple kegs need linking
-rw-r--r--Library/Homebrew/formula_installer.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 06ac93975..9cbe5f235 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -40,12 +40,13 @@ class FormulaInstaller
raise CannotInstallFormulaError, "No head is defined for #{f.name}"
end
- f.recursive_deps.each do |dep|
- if dep.installed? and not dep.keg_only? and not dep.linked_keg.directory?
- raise CannotInstallFormulaError,
- "You must `brew link #{dep}' before #{f} can be installed"
+ unless ignore_deps
+ unlinked_deps = f.recursive_deps.select do |dep|
+ dep.installed? and not dep.keg_only? and not dep.linked_keg.directory?
end
- end unless ignore_deps
+ raise CannotInstallFormulaError,
+ "You must `brew link #{unlinked_deps*' '}' before #{f} can be installed" unless unlinked_deps.empty?
+ end
rescue FormulaUnavailableError => e
# this is sometimes wrong if the dependency chain is more than one deep