Skip to content
Snippets Groups Projects
Commit 12932a51 authored by Jack Nagel's avatar Jack Nagel
Browse files

Don't error out when a package is already installed

Fixes Homebrew/homebrew#17010.
parent d25b4e40
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -71,6 +71,9 @@ end
class CannotInstallFormulaError < RuntimeError
end
class FormulaAlreadyInstalledError < RuntimeError
end
class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError
def message
"Formula installation already attempted: #{formula}"
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment