diff options
| author | Max Howell | 2009-09-02 23:21:57 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-02 23:24:14 +0100 |
| commit | b4259082b56b2c3a4fcecec6d519f83f53fc4fa8 (patch) | |
| tree | 2589e63d58bcf336271833c13dbb899567d88e82 | |
| parent | 9feceae461e6ce2133be1c49ef237a971244cd54 (diff) | |
| download | homebrew-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.rb | 3 |
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}` |
