Don't error out when a package is already installed
Fixes Homebrew/homebrew#17010.
This commit is contained in:
parent
d25b4e40c1
commit
12932a51b3
@ -91,6 +91,8 @@ module Homebrew extend self
|
|||||||
rescue FormulaInstallationAlreadyAttemptedError
|
rescue FormulaInstallationAlreadyAttemptedError
|
||||||
# We already attempted to install f as part of the dependency tree of
|
# 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.
|
# another formula. In that case, don't generate an error, just move on.
|
||||||
|
rescue FormulaAlreadyInstalledError => e
|
||||||
|
opoo e.message
|
||||||
rescue CannotInstallFormulaError => e
|
rescue CannotInstallFormulaError => e
|
||||||
ofail e.message
|
ofail e.message
|
||||||
end
|
end
|
||||||
|
|||||||
@ -71,6 +71,9 @@ end
|
|||||||
class CannotInstallFormulaError < RuntimeError
|
class CannotInstallFormulaError < RuntimeError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class FormulaAlreadyInstalledError < RuntimeError
|
||||||
|
end
|
||||||
|
|
||||||
class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError
|
class FormulaInstallationAlreadyAttemptedError < Homebrew::InstallationError
|
||||||
def message
|
def message
|
||||||
"Formula installation already attempted: #{formula}"
|
"Formula installation already attempted: #{formula}"
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class FormulaInstaller
|
|||||||
if f.installed?
|
if f.installed?
|
||||||
msg = "#{f}-#{f.installed_version} already 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?
|
msg << ", it's just not linked" if not f.linked_keg.symlink? and not f.keg_only?
|
||||||
raise CannotInstallFormulaError, msg
|
raise FormulaAlreadyInstalledError, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
# Building head-only without --HEAD is an error
|
# Building head-only without --HEAD is an error
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user