diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index ef01d0452c..f44f670913 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -91,6 +91,8 @@ module Homebrew extend self rescue FormulaInstallationAlreadyAttemptedError # We already attempted to install f as part of the dependency tree of # another formula. In that case, don't generate an error, just move on. + rescue FormulaAlreadyInstalledError => e + opoo e.message rescue CannotInstallFormulaError => e ofail e.message end diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 43075003a4..d57f5ddc3b 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -71,6 +71,9 @@ end class CannotInstallFormulaError < RuntimeError end +class FormulaAlreadyInstalledError < RuntimeError +end + class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError def message "Formula installation already attempted: #{formula}" diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 0b94c5b623..7f94b1d9ed 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -34,7 +34,7 @@ class FormulaInstaller if f.installed? msg = "#{f}-#{f.installed_version} already installed" msg << ", it's just not linked" if not f.linked_keg.symlink? and not f.keg_only? - raise CannotInstallFormulaError, msg + raise FormulaAlreadyInstalledError, msg end # Building head-only without --HEAD is an error