diff options
| author | Jack Nagel | 2013-04-03 18:26:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-04-03 18:27:28 -0500 |
| commit | 12932a51b33d1afe2837de572a8d5ba409569626 (patch) | |
| tree | f05a7b455098a8fe3ceebdd520137ba8bde937e5 /Library | |
| parent | d25b4e40c11efe9bfb08c3bd79c11d001adb50b6 (diff) | |
| download | brew-12932a51b33d1afe2837de572a8d5ba409569626.tar.bz2 | |
Don't error out when a package is already installed
Fixes Homebrew/homebrew#17010.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 3 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index ef01d0452..f44f67091 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 43075003a..d57f5ddc3 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 0b94c5b62..7f94b1d9e 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 |
