Only mark install as attempted if it was actually attempted
Commit 30a08f5cc707 ("Don't attempt installation multiple times") was
correct in raising FormulaInstallationAlreadyAttemptedError early enough
to prevent the other exceptions in #check_install_sanity from being
raised, but it should not have moved the point at which formulae are
added to the attempted set. Doing so prevents the installer from being
instantiated multiple times on the same formula, even if installation
was never attempted.
Put it back where it belongs.
This commit is contained in:
parent
900a5fec2d
commit
8f88850cdb
@ -20,13 +20,13 @@ class FormulaInstaller
|
|||||||
@ignore_deps = ARGV.ignore_deps? || ARGV.interactive?
|
@ignore_deps = ARGV.ignore_deps? || ARGV.interactive?
|
||||||
@install_bottle = install_bottle? ff
|
@install_bottle = install_bottle? ff
|
||||||
|
|
||||||
|
@@attempted ||= Set.new
|
||||||
|
|
||||||
check_install_sanity
|
check_install_sanity
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_install_sanity
|
def check_install_sanity
|
||||||
@@attempted ||= Set.new
|
|
||||||
raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f
|
raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f
|
||||||
@@attempted << f
|
|
||||||
|
|
||||||
if f.installed?
|
if f.installed?
|
||||||
msg = "#{f}-#{f.installed_version} already installed"
|
msg = "#{f}-#{f.installed_version} already installed"
|
||||||
@ -116,6 +116,8 @@ class FormulaInstaller
|
|||||||
|
|
||||||
oh1 "Installing #{Tty.green}#{f}#{Tty.reset}" if show_header
|
oh1 "Installing #{Tty.green}#{f}#{Tty.reset}" if show_header
|
||||||
|
|
||||||
|
@@attempted << f
|
||||||
|
|
||||||
if install_bottle
|
if install_bottle
|
||||||
pour
|
pour
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user