Merge pull request #8548 from SeekingMeaning/cmd/installed_prefix

install, livecheck: use `opt_or_installed_prefix_keg`
This commit is contained in:
Mike McQuaid 2020-09-01 08:51:42 +01:00 committed by GitHub
commit 6e1346f991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)