diff options
| author | Max Howell | 2012-03-15 12:32:03 +0000 |
|---|---|---|
| committer | Max Howell | 2012-03-15 13:02:47 +0000 |
| commit | 59436b194d0ea19b3c6459d61967a6c0c3aa6a25 (patch) | |
| tree | b171ea42cd4db9e40b9aae155e533d5a63a1ccc2 /Library | |
| parent | 33221835dc23cb173a3c0fbd5c14ece9a77cae6b (diff) | |
| download | brew-59436b194d0ea19b3c6459d61967a6c0c3aa6a25.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.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 6 |
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 |
