aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/cleanup.rb
diff options
context:
space:
mode:
authorSimon Sigurdhsson2012-08-04 18:50:17 +0200
committerMike McQuaid2013-02-02 14:05:40 -0800
commitaf3bfab9db74951783aa3d90ee36d5aa9547b15a (patch)
tree59b0333a75e3da70ff096e3f9c4a34966024bf03 /Library/Homebrew/cmd/cleanup.rb
parentc0822f84001081071845a43371ef9be866b9cc26 (diff)
downloadbrew-af3bfab9db74951783aa3d90ee36d5aa9547b15a.tar.bz2
Make `CurlDownloadStrategy` resume aborted downloads
* `CurlDownloadStrategy#_fetch` (and the same methods in its subclasses) now fetches the file to a temporary path, and `CurlDownloadStrategy#fetch` moves it to the correct location. * `Homebrew#cleanup` cleans the temporary files `CurlDownloadStrategy` creates if they're left in the cache. Closes Homebrew/homebrew#13953. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd/cleanup.rb')
-rw-r--r--Library/Homebrew/cmd/cleanup.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb
index 6b4e6b400..490065606 100644
--- a/Library/Homebrew/cmd/cleanup.rb
+++ b/Library/Homebrew/cmd/cleanup.rb
@@ -77,6 +77,10 @@ module Homebrew extend self
end
end
end
+ if pn.basename.to_s.split('.').last == 'incomplete'
+ puts "Removing #{pn}..."
+ rm pn unless ARGV.dry_run?
+ end
end
end