parent
6eb220d78f
commit
8d44db6b40
@ -27,7 +27,7 @@ module Homebrew extend self
|
||||
files = []
|
||||
tapd.find_formula { |file| files << file }
|
||||
link_tap_formula(files)
|
||||
puts "Tapped #{files.length} formula"
|
||||
puts "Tapped #{files.length} formula#{plural(files.length, 'e')}"
|
||||
|
||||
if private_tap?(repouser, repo) then puts <<-EOS.undent
|
||||
It looks like you tapped a private repository. To avoid entering your
|
||||
@ -77,7 +77,7 @@ module Homebrew extend self
|
||||
count += 1
|
||||
end
|
||||
end
|
||||
puts "Pruned #{count} dead formula"
|
||||
puts "Pruned #{count} dead formula#{plural(count, 'e')}"
|
||||
|
||||
return unless HOMEBREW_REPOSITORY.join("Library/Taps").exist?
|
||||
|
||||
@ -89,7 +89,7 @@ module Homebrew extend self
|
||||
count += link_tap_formula(files)
|
||||
end
|
||||
|
||||
puts "Tapped #{count} formula"
|
||||
puts "Tapped #{count} formula#{plural(count, 'e')}"
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -22,7 +22,7 @@ module Homebrew extend self
|
||||
unlink_tap_formula(files)
|
||||
tapd.rmtree
|
||||
tapd.dirname.rmdir_if_possible
|
||||
puts "Untapped #{files.length} formula"
|
||||
puts "Untapped #{files.length} formula#{plural(files.length, 'e')}"
|
||||
end
|
||||
|
||||
def unlink_tap_formula paths
|
||||
|
@ -1,12 +1,6 @@
|
||||
require 'cmd/install'
|
||||
require 'cmd/outdated'
|
||||
|
||||
class Fixnum
|
||||
def plural_s
|
||||
if self != 1 then "s" else "" end
|
||||
end
|
||||
end
|
||||
|
||||
module Homebrew extend self
|
||||
def upgrade
|
||||
Homebrew.perform_preinstall_checks
|
||||
@ -35,14 +29,14 @@ module Homebrew extend self
|
||||
end
|
||||
|
||||
unless outdated.empty?
|
||||
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
|
||||
oh1 "Upgrading #{outdated.length} outdated package#{plural(outdated.length)}, with result:"
|
||||
puts outdated.map{ |f| "#{f.name} #{f.pkg_version}" } * ", "
|
||||
else
|
||||
oh1 "No packages to upgrade"
|
||||
end
|
||||
|
||||
unless upgrade_pinned? || pinned.empty?
|
||||
oh1 "Not upgrading #{pinned.length} pinned package#{pinned.length.plural_s}:"
|
||||
oh1 "Not upgrading #{pinned.length} pinned package#{plural(pinned.length)}:"
|
||||
puts pinned.map{ |f| "#{f.name} #{f.pkg_version}" } * ", "
|
||||
end
|
||||
|
||||
|
@ -78,6 +78,10 @@ def pretty_duration s
|
||||
return "%.1f minutes" % (s/60)
|
||||
end
|
||||
|
||||
def plural n, s="s"
|
||||
(n == 1) ? "" : s
|
||||
end
|
||||
|
||||
def interactive_shell f=nil
|
||||
unless f.nil?
|
||||
ENV['HOMEBREW_DEBUG_PREFIX'] = f.prefix
|
||||
|
Loading…
x
Reference in New Issue
Block a user