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
commit27263784d187fce20147bda311b439c12a770af5 (patch)
tree549a89755f9a9dac25fabbaa03e187121b07825a /Library
parent2f5bcc935a00de7188c4bbb0475fe367198cf3c7 (diff)
downloadhomebrew-27263784d187fce20147bda311b439c12a770af5.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}`