aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2017-03-31 09:43:47 +0100
committerGitHub2017-03-31 09:43:47 +0100
commit80b39bb23917d9b80bb80eb15a890607d69e65b6 (patch)
treef43ee6966970a9c32dcf3ef9e61bf0ee362f0dd6 /Library/Homebrew/cmd
parent1ba401039eeafec6dca464e9be18a5257a3d89bc (diff)
parent48fdd163bcf9ab52f4ac708def700b7b6ab218a4 (diff)
downloadbrew-80b39bb23917d9b80bb80eb15a890607d69e65b6.tar.bz2
Merge pull request #2374 from joshka/cleanup-command-continue-on-error
Cleanup: Continue on error removing keg
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/cleanup.rb14
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