diff options
Diffstat (limited to 'Library/Homebrew/cmd/cleanup.rb')
| -rw-r--r-- | Library/Homebrew/cmd/cleanup.rb | 14 | 
1 files changed, 12 insertions, 2 deletions
| diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 126309579..d8f669e85 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -21,11 +21,14 @@ module Homebrew      if ARGV.named.empty?        Cleanup.cleanup      else -      ARGV.resolved_formulae.each { |f| Cleanup.cleanup_formula f } +      Cleanup.cleanup_cellar(ARGV.resolved_formulae)      end -    return if Cleanup.disk_cleanup_size.zero? +    report_disk_usage unless Cleanup.disk_cleanup_size.zero? +    report_unremovable_kegs unless Cleanup.unremovable_kegs.empty? +  end +  def report_disk_usage      disk_space = disk_usage_readable(Cleanup.disk_cleanup_size)      if ARGV.dry_run?        ohai "This operation would free approximately #{disk_space} of disk space." @@ -33,4 +36,11 @@ module Homebrew        ohai "This operation has freed approximately #{disk_space} of disk space."      end    end + +  def report_unremovable_kegs +    ofail <<-EOS.undent +      Could not cleanup old kegs! Fix your permissions on: +        #{Cleanup.unremovable_kegs.join "\n  "} +    EOS +  end  end | 
