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:
Jack Nagel 2013-01-13 15:39:50 -06:00
parent 900a5fec2d
commit 8f88850cdb

View File

@ -20,13 +20,13 @@ class FormulaInstaller
@ignore_deps = ARGV.ignore_deps? || ARGV.interactive?
@install_bottle = install_bottle? ff
@@attempted ||= Set.new
check_install_sanity
end
def check_install_sanity
@@attempted ||= Set.new
raise FormulaInstallationAlreadyAttemptedError, f if @@attempted.include? f
@@attempted << f
if f.installed?
msg = "#{f}-#{f.installed_version} already installed"
@ -116,6 +116,8 @@ class FormulaInstaller
oh1 "Installing #{Tty.green}#{f}#{Tty.reset}" if show_header
@@attempted << f
if install_bottle
pour
else