Merge pull request #6143 from letmaik/letmaik/HOMEBREW_CURL_RETRIES

Add HOMEBREW_CURL_RETRIES (#6142)
This commit is contained in:
Mike McQuaid 2019-05-18 19:17:02 +01:00 committed by GitHub
commit bcc5f042bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 0 deletions

View File

@ -158,6 +158,9 @@ Note that environment variables must have a value set to be detected. For exampl
* `HOMEBREW_CURL_VERBOSE`:
If set, Homebrew will pass `--verbose` when invoking `curl`(1).
* `HOMEBREW_CURL_RETRIES`:
If set, Homebrew will pass the given retry count to `--retry` when invoking `curl`(1).
* `HOMEBREW_DEBUG`:
If set, any commands that can emit debugging information will do so.

View File

@ -13,5 +13,10 @@ describe "curl" do
ENV["HOMEBREW_CURLRC"] = "1"
expect(curl_args("foo").first).not_to eq("-q")
end
it "returns --retry when HOMEBREW_CURL_RETRIES is set" do
ENV["HOMEBREW_CURL_RETRIES"] = "3"
expect(curl_args("foo").join(" ")).to include("--retry 3")
end
end
end

View File

@ -37,6 +37,8 @@ def curl_args(*extra_args, show_output: false, user_agent: :default)
args << "--silent" unless $stdout.tty?
end
args << "--retry" << ENV["HOMEBREW_CURL_RETRIES"] if ENV["HOMEBREW_CURL_RETRIES"]
args + extra_args
end

View File

@ -1045,6 +1045,9 @@ Note that environment variables must have a value set to be detected. For exampl
* `HOMEBREW_CURL_VERBOSE`:
If set, Homebrew will pass `--verbose` when invoking `curl`(1).
* `HOMEBREW_CURL_RETRIES`:
If set, Homebrew will pass the given retry count to `--retry` when invoking `curl`(1).
* `HOMEBREW_DEBUG`:
If set, any commands that can emit debugging information will do so.

View File

@ -1278,6 +1278,10 @@ If set, Homebrew will not pass \fB\-q\fR when invoking \fBcurl\fR(1) (which disa
If set, Homebrew will pass \fB\-\-verbose\fR when invoking \fBcurl\fR(1)\.
.
.TP
\fBHOMEBREW_CURL_RETRIES\fR
If set, Homebrew will pass the given retry count to \fB\-\-retry\fR when invoking \fBcurl\fR(1)\.
.
.TP
\fBHOMEBREW_DEBUG\fR
If set, any commands that can emit debugging information will do so\.
.