upgrade: fix output when no packages to upgrade.

When upgrading, if the only package to upgrade is a
pinned package, the output looked like that:
	==> Upgrading 0 packages, with result:

	==> Not upgrading 1 pinned package:
	<<package_name & version>>

The blank line is not beautiful. This commit fixes
the output and replaces with:
	==> No packages to upgrade
	==> Not upgrading 1 pinned package:
	<<package_name & version>>

Closes Homebrew/homebrew#26157.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Frizlab 2014-01-25 06:30:46 +01:00 committed by Mike McQuaid
parent 8c6c644a6b
commit 5de3686cd2

View File

@ -34,8 +34,12 @@ module Homebrew extend self
outdated -= pinned
end
unless outdated.empty?
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
else
oh1 "No packages to upgrade"
end
unless upgrade_pinned? || pinned.empty?
oh1 "Not upgrading #{pinned.length} pinned package#{pinned.length.plural_s}:"