diff options
| author | Jack Nagel | 2013-01-08 19:54:32 -0600 | 
|---|---|---|
| committer | Jack Nagel | 2013-01-10 16:46:54 -0600 | 
| commit | 30a08f5cc707e111685d2e73a862a95a5d8529ba (patch) | |
| tree | fd7debe58fbdb9ab67c3ec3fc2fe36d42095ec1a /Library/Homebrew/cmd/upgrade.rb | |
| parent | e13842ac4764ec424dd52eec23108ff626a4a98c (diff) | |
| download | homebrew-30a08f5cc707e111685d2e73a862a95a5d8529ba.tar.bz2 | |
Don't attempt installation multiple times
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.
For example:
  $ brew install graphviz pkg-config
  ==> Installing graphviz dependency: pkg-config
  ...
  ==> Installing graphviz
  ...
  Error: pkg-config-0.27.1 already installed
We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.
Fixes #16957.
Diffstat (limited to 'Library/Homebrew/cmd/upgrade.rb')
| -rw-r--r-- | Library/Homebrew/cmd/upgrade.rb | 3 | 
1 files changed, 3 insertions, 0 deletions
| diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 06dfb8732..c3a924ec5 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -73,6 +73,9 @@ module Homebrew extend self      installer.install      installer.caveats      installer.finish +  rescue FormulaInstallationAlreadyAttemptedError +    # We already attempted to upgrade f as part of the dependency tree of +    # another formula. In that case, don't generate an error, just move on.    rescue CannotInstallFormulaError => e      ofail e    rescue BuildError => e | 
