diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 3f3f722351..e8ed5ad630 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