diff options
| author | Jack Nagel | 2014-02-28 11:16:55 -0600 |
|---|---|---|
| committer | Jack Nagel | 2014-02-28 11:16:55 -0600 |
| commit | 369f9b3251e1206eab10c778e591e054f4a7942b (patch) | |
| tree | d779363630dee4fcdbbb9372497fc42c4966ffed /Library | |
| parent | d0f43ad3673edc39d52a2868ce1a0caff27813c1 (diff) | |
| download | brew-369f9b3251e1206eab10c778e591e054f4a7942b.tar.bz2 | |
FormulaInstaller: verify dependencies map to formulae before locking
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 3f3f72235..e8ed5ad63 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -31,6 +31,7 @@ class FormulaInstaller @poured_bottle = false @pour_failed = false + verify_deps_exist lock check_install_sanity end @@ -41,6 +42,13 @@ class FormulaInstaller install_bottle?(f, install_bottle_options) end + def verify_deps_exist + f.recursive_dependencies.map(&:to_formula) + rescue FormulaUnavailableError => e + e.dependent = f.name + raise + end + def check_install_sanity raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f @@ -70,12 +78,6 @@ class FormulaInstaller 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 - # but can't easily fix this without a rewrite FIXME-brew2 - e.dependent = f.name - raise end def build_bottle_preinstall |
