aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-09-02 23:21:57 +0100
committerMax Howell2009-09-02 23:24:14 +0100
commitb4259082b56b2c3a4fcecec6d519f83f53fc4fa8 (patch)
tree2589e63d58bcf336271833c13dbb899567d88e82
parent9feceae461e6ce2133be1c49ef237a971244cd54 (diff)
downloadhomebrew-b4259082b56b2c3a4fcecec6d519f83f53fc4fa8.tar.bz2
If the download fails, delete the half-file
Otherwise next time it will assume the half-file is the whole file and fail the md5 check.
-rw-r--r--Library/Homebrew/download_strategy.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 341bdb765..49b071a0a 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -42,6 +42,9 @@ class HttpDownloadStrategy <AbstractDownloadStrategy
puts "File already downloaded and cached"
end
return @dl # thus performs checksum verification
+ rescue Exception
+ @dl.unlink
+ raise "There was an error downloading the file:\n#{@url}"
end
def stage
case `file -b #{@dl}`