install, upgrade: fix installation attempt check

This commit is contained in:
fn ⌃ ⌥ 2021-09-13 07:38:01 -07:00
parent 9c03493774
commit 5a94c43b3f
2 changed files with 4 additions and 6 deletions

View File

@ -314,10 +314,6 @@ module Homebrew
def install_formula(formula_installer)
f = formula_installer.formula
formula_installer.check_installation_already_attempted
f.print_tap_action
upgrade = f.linked? && f.outdated? && !f.head? && !Homebrew::EnvConfig.no_install_upgrade?
Upgrade.install_formula(formula_installer, upgrade: upgrade)

View File

@ -177,8 +177,6 @@ module Homebrew
return
end
formula_installer.check_installation_already_attempted
install_formula(formula_installer, upgrade: true)
rescue BuildError => e
e.dump(verbose: verbose)
@ -190,11 +188,15 @@ module Homebrew
def install_formula(formula_installer, upgrade:)
formula = formula_installer.formula
formula_installer.check_installation_already_attempted
if upgrade
print_upgrade_message(formula, formula_installer.options)
kegs = outdated_kegs(formula)
linked_kegs = kegs.select(&:linked?)
else
formula.print_tap_action
end
# first we unlink the currently active keg for this formula otherwise it is