Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HOMEBREW_CURL_RETRIES (#6142) #6143

Merged
merged 1 commit into from May 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Library/Homebrew/manpages/brew.1.md.erb
Expand Up @@ -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.

Expand Down
5 changes: 5 additions & 0 deletions Library/Homebrew/test/utils/curl_spec.rb
Expand Up @@ -13,5 +13,10 @@
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
2 changes: 2 additions & 0 deletions Library/Homebrew/utils/curl.rb
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docs/Manpage.md
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions manpages/brew.1
Expand Up @@ -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\.
.
Expand Down