From 4e7bb6c63766b457d07641e881da32a90f3f5872 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 19 Aug 2012 17:36:10 -0400 Subject: [PATCH] Better message if multiple kegs need linking --- Library/Homebrew/formula_installer.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 06ac93975c..9cbe5f235d 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