diff options
| author | Max Howell | 2009-09-05 20:47:15 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-05 20:47:15 +0100 |
| commit | de620e439691b540822b76c361cea0c96362606b (patch) | |
| tree | be7e5c0f9a969ef3ff1ece7c7705b51850ce89f8 /Library | |
| parent | 680e2019233c8ed17a62ce2cb2d8308b3593d977 (diff) | |
| download | brew-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.sh | 4 | ||||
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 10 |
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}` |
