aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMax Howell2009-09-05 20:47:15 +0100
committerMax Howell2009-09-05 20:47:15 +0100
commitde620e439691b540822b76c361cea0c96362606b (patch)
treebe7e5c0f9a969ef3ff1ece7c7705b51850ce89f8 /Library/Homebrew
parent680e2019233c8ed17a62ce2cb2d8308b3593d977 (diff)
downloadbrew-de620e439691b540822b76c361cea0c96362606b.tar.bz2
No spurious error due to Interrupt during curl
Only delete the file that is downloaded if an error occurs while downloading it.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/download_strategy.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 49b071a0a..2cd85f3bb 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -37,14 +37,16 @@ class HttpDownloadStrategy <AbstractDownloadStrategy
@dl=HOMEBREW_CACHE+File.basename(@url)
end
unless @dl.exist?
- curl @url, '-o', @dl
+ begin
+ curl @url, '-o', @dl
+ rescue
+ @dl.unlink
+ raise
+ end
else
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}`