From a2840225d80c042bacaf66bb66cc73c0ff01c667 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 13 Jan 2013 15:39:50 -0600 Subject: 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. --- Library/Homebrew/formula_installer.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 897a03afe..221690576 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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 -- cgit v1.2.3