aboutsummaryrefslogtreecommitdiffstats
path: root/Library
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
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')
-rw-r--r--Library/Contributions/brew_bash_completion.sh4
-rw-r--r--Library/Homebrew/download_strategy.rb10
2 files changed, 7 insertions, 7 deletions
diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh
index f33204d36..4711c93bb 100644
--- a/Library/Contributions/brew_bash_completion.sh
+++ b/Library/Contributions/brew_bash_completion.sh
@@ -1,9 +1,7 @@
# This script contains bash completions for brew.
+#
# To use, edit your .bashrc and add the line:
# source `brew --prefix`/Library/Contributions/brew_bash_completion.sh
-#
-# Assuming you have brew installed in /usr/local, then you'll want:
-# source /usr/local/Library/Contributions/brew_bash_completion.sh
_brew_to_completion()
{
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}`