aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2012-03-15 12:32:03 +0000
committerMax Howell2012-03-15 13:02:47 +0000
commit5adc55ac0ab534cf9a2aa11f6e286b0b0e8b2fd8 (patch)
tree34dd2d1a08155567e95dcc9c97171975ffdbe21d
parentfe51fc4cc585a0a64b87f6e2439f763542bb85ef (diff)
downloadhomebrew-5adc55ac0ab534cf9a2aa11f6e286b0b0e8b2fd8.tar.bz2
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.
-rw-r--r--Library/Homebrew/formula_installer.rb6
1 files changed, 6 insertions, 0 deletions
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