Skip to content
Snippets Groups Projects
Unverified Commit 11b2e3fb authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #9053 from MikeMcQuaid/outdated-upgrade-alias-fix

outdated/upgrade: fix upgrade alias edge case.
parents 0802d626 0606c9fd
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ module Homebrew
if verbose?
outdated_kegs = f.outdated_kegs(fetch_head: args.fetch_HEAD?)
current_version = if f.alias_changed?
current_version = if f.alias_changed? && !f.latest_formula.latest_version_installed?
latest = f.latest_formula
"#{latest.name} (#{latest.pkg_version})"
elsif f.head? && outdated_kegs.any? { |k| k.version.to_s == f.pkg_version.to_s }
......
......@@ -137,7 +137,14 @@ module Homebrew
pinned = outdated.select(&:pinned?)
outdated -= pinned
formulae_to_install = outdated.map(&:latest_formula)
formulae_to_install = outdated.map do |f|
f_latest = f.latest_formula
if f_latest.latest_version_installed?
f
else
f_latest
end
end
if !pinned.empty? && !args.ignore_pinned?
ofail "Not upgrading #{pinned.count} pinned #{"package".pluralize(pinned.count)}:"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment