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.
This commit is contained in:
Max Howell 2009-09-02 23:21:57 +01:00
parent ce3b7c9826
commit 5eb51cb766

View File

@ -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}`