install, livecheck: use opt_or_installed_prefix_keg

This commit is contained in:
Seeker 2020-08-31 09:59:02 -07:00
parent a48a8722fc
commit ce90a534da
2 changed files with 7 additions and 2 deletions

View File

@ -219,7 +219,8 @@ module Homebrew
end
opoo msg if msg
elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first
msg = "#{old_formula.full_name} #{old_formula.installed_version} already installed"
installed_version = old_formula.opt_or_installed_prefix_keg.version
msg = "#{old_formula.full_name} #{installed_version} already installed"
if !old_formula.linked? && !old_formula.keg_only?
msg = <<~EOS
#{msg}, it's just not linked.

View File

@ -80,7 +80,11 @@ module Homebrew
formula.head.downloader.shutup! if formula.head?
current = formula.head? ? formula.installed_version.version.commit : formula.version
current = if formula.head?
formula.opt_or_installed_prefix_keg.version.version.commit
else
formula.version
end
latest = if formula.stable?
version_info = latest_version(formula, args: args)