aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-08-23 18:23:21 +0200
committerGitHub2017-08-23 18:23:21 +0200
commit7d5971e84c8e704afd60485cda75b6fb6438aa9c (patch)
tree7d15ee48e5fbddc6b74659a2f5706ca74d0bc1ff
parent97c75bfd40084cfa2512fe55a7b292886ff6d023 (diff)
parent15e572702e8dbd998e31aec110bce3cc0c9df811 (diff)
downloadbrew-7d5971e84c8e704afd60485cda75b6fb6438aa9c.tar.bz2
Merge pull request #3075 from reitermarkus/fix-pull
Fix `pull`.
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb2
-rw-r--r--Library/Homebrew/utils/curl.rb7
2 files changed, 4 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index dd2bc6270..a8f35531f 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -587,7 +587,7 @@ module Homebrew
# We're in the cache; make sure to force re-download
loop do
begin
- curl_download url, to: filename
+ curl_download url, continue_at: 0, to: filename
break
rescue
if retry_count >= max_curl_retries
diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb
index 52d03c93e..bc7055c0c 100644
--- a/Library/Homebrew/utils/curl.rb
+++ b/Library/Homebrew/utils/curl.rb
@@ -37,13 +37,12 @@ def curl(*args)
safe_system(*curl_args(*args))
end
-def curl_download(*args, to: nil, **options)
- continue_at ||= "-"
- curl("--location", "--remote-time", "--continue-at", continue_at, "--output", to, *args, **options)
+def curl_download(*args, to: nil, continue_at: "-", **options)
+ curl("--location", "--remote-time", "--continue-at", continue_at.to_s, "--output", to, *args, **options)
rescue ErrorDuringExecution
# `curl` error 33: HTTP server doesn't seem to support byte ranges. Cannot resume.
if $CHILD_STATUS.exitstatus == 33 && continue_at == "-"
- continue_at = "0"
+ continue_at = 0
retry
end