From 59436b194d0ea19b3c6459d61967a6c0c3aa6a25 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 15 Mar 2012 12:32:03 +0000 Subject: Abort installs if reps are installed but not linked Except for keg-only reps of course. I suspect quite a few bug reports we receive are due to this sort of thing. Ideally we'd not do this check for deps, since they have already been checked. I fear some weird consequences. But this check *should* be done before unlinking the previously installed brew in the case of upgrades. And the ignore_deps flag is set after the initialiser. There are ways round this but the code would be less nice.--- Library/Homebrew/formula_installer.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index c09621cee..479232cd1 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -38,6 +38,12 @@ class FormulaInstaller if ARGV.build_head? and f.unstable.nil? 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" + end + end unless ignore_deps end def install -- cgit v1.2.3