aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-09-02 23:21:57 +0100
committerMax Howell2009-09-02 23:24:14 +0100
commit5eb51cb766b8b05c4ab19e571142d179481dee9b (patch)
treec0f3817adeeb1bd85b2fb8c03e766c19cb9e8fc1
parentce3b7c982646ab6859e99e78b18ed69a772f9265 (diff)
downloadbrew-5eb51cb766b8b05c4ab19e571142d179481dee9b.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}`