cmd/upgrade: output the outdated version.

This makes it clearer what version is being updated to what version.
This commit is contained in:
Mike McQuaid 2018-03-30 15:00:45 +01:00
parent ed8cae93ab
commit 5b68bb84d2

View File

@ -67,7 +67,14 @@ module Homebrew
oh1 "No packages to upgrade" oh1 "No packages to upgrade"
else else
oh1 "Upgrading #{Formatter.pluralize(formulae_to_install.length, "outdated package")}, with result:" oh1 "Upgrading #{Formatter.pluralize(formulae_to_install.length, "outdated package")}, with result:"
puts formulae_to_install.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", " formulae_upgrades = formulae_to_install.map do |f|
if f.optlinked?
"#{f.full_specified_name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}"
else
"#{f.full_specified_name} #{f.pkg_version}"
end
end
puts formulae_upgrades.join(", ")
end end
# Sort keg_only before non-keg_only formulae to avoid any needless conflicts # Sort keg_only before non-keg_only formulae to avoid any needless conflicts