aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrizlab2014-01-25 06:30:46 +0100
committerMike McQuaid2014-01-26 18:04:20 +0100
commit5de3686cd2e041dae893f9e84d74c925cb6c85f5 (patch)
tree2c1c54f63f34f7e5df1859f82fc57fd1fd96c805
parent8c6c644a6b1ae4d3ae377fbb4a869aaa1ce84095 (diff)
downloadbrew-5de3686cd2e041dae893f9e84d74c925cb6c85f5.tar.bz2
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>
-rw-r--r--Library/Homebrew/cmd/upgrade.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index ed3529e98..a68830a94 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -34,8 +34,12 @@ module Homebrew extend self
outdated -= pinned
end
- oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
- puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
+ 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}:"