diff options
| author | Xu Cheng | 2015-06-18 21:46:47 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-06-20 14:44:09 +0800 |
| commit | 05d9622c0298004f6cbfc678728cce7c32f38451 (patch) | |
| tree | b0a95c101a8c748f823bb6fd77abddc2055fad18 /Library | |
| parent | 7c83e3ffe38cdeb3287b275b202e2a1cdaab5bf8 (diff) | |
| download | brew-05d9622c0298004f6cbfc678728cce7c32f38451.tar.bz2 | |
download_strategy: don't check url if already downloaded
Closes Homebrew/homebrew#40859.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 93cd4250c..1b84a2422 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -270,16 +270,16 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy def fetch ohai "Downloading #{@url}" - urls = actual_urls - unless urls.empty? - ohai "Downloading from: #{urls.last}" - if !ENV["HOMEBREW_NO_INSECURE_REDIRECT"].nil? && @url.start_with?("https://") && - urls.any? { |u| !u.start_with? "https://" } - raise "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set." + unless cached_location.exist? + urls = actual_urls + unless urls.empty? + ohai "Downloading from: #{urls.last}" + if !ENV["HOMEBREW_NO_INSECURE_REDIRECT"].nil? && @url.start_with?("https://") && + urls.any? { |u| !u.start_with? "https://" } + raise "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set." + end end - end - unless cached_location.exist? had_incomplete_download = temporary_path.exist? begin _fetch |
