Remove incomplete files in cache on brew cleanup

Closes Homebrew/homebrew#44182.
Closes Homebrew/homebrew#44349.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Forrest Fleming 2015-09-26 00:24:23 -07:00 committed by Xu Cheng
parent 9ae6f6d3ac
commit e0f9994542

View File

@ -57,6 +57,10 @@ module Homebrew
def cleanup_cache
return unless HOMEBREW_CACHE.directory?
HOMEBREW_CACHE.children.each do |path|
if path.to_s.end_with? ".incomplete"
cleanup_path(path) { path.unlink }
next
end
if prune?(path)
if path.file?
cleanup_path(path) { path.unlink }