Add/use HOMEBREW_CURLRC variable.

This commit is contained in:
Mike McQuaid 2018-04-08 15:51:58 -07:00
parent 0ec47813f1
commit 0bd5869319
6 changed files with 31 additions and 9 deletions

View File

@ -47,8 +47,15 @@ fetch() {
local sha
local temporary_path
curl_args=(
-q # do not load .curlrc (must be the first argument)
curl_args=()
# do not load .curlrc unless requested (must be the first argument)
if [[ -n "$HOMEBREW_CURLRC" ]]
then
curl_args[${#curl_args[*]}]="-q"
fi
curl_args+=(
--fail
--remote-time
--location

View File

@ -136,6 +136,10 @@ can take several different forms:
*Default:* `~/Library/Caches/Homebrew`.
* `HOMEBREW_CURLRC`:
If set, Homebrew will not pass `-q` when invoking `curl`(1) (which disables
the use of `curlrc`).
* `HOMEBREW_CURL_VERBOSE`:
If set, Homebrew will pass `--verbose` when invoking `curl`(1).

View File

@ -12,11 +12,14 @@ def curl_executable
end
def curl_args(*extra_args, show_output: false, user_agent: :default)
args = [
curl_executable.to_s,
"-q", # do not load .curlrc (must be the first argument)
"--show-error",
]
args = [curl_executable.to_s]
# do not load .curlrc unless requested (must be the first argument)
if ENV["HOMEBREW_CURLRC"]
args << "-q"
end
args << "--show-error"
args << "--user-agent" << case user_agent
when :browser, :fake

View File

@ -1110,6 +1110,10 @@ can take several different forms:
*Default:* `~/Library/Caches/Homebrew`.
* `HOMEBREW_CURLRC`:
If set, Homebrew will not pass `-q` when invoking `curl`(1) (which disables
the use of `curlrc`).
* `HOMEBREW_CURL_VERBOSE`:
If set, Homebrew will pass `--verbose` when invoking `curl`(1).

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BREW\-CASK" "1" "March 2018" "Homebrew" "brew-cask"
.TH "BREW\-CASK" "1" "April 2018" "Homebrew" "brew-cask"
.
.SH "NAME"
\fBbrew\-cask\fR \- a friendly binary installer for macOS

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BREW" "1" "March 2018" "Homebrew" "brew"
.TH "BREW" "1" "April 2018" "Homebrew" "brew"
.
.SH "NAME"
\fBbrew\fR \- The missing package manager for macOS
@ -1128,6 +1128,10 @@ If set, instructs Homebrew to use the given directory as the download cache\.
\fIDefault:\fR \fB~/Library/Caches/Homebrew\fR\.
.
.TP
\fBHOMEBREW_CURLRC\fR
If set, Homebrew will not pass \fB\-q\fR when invoking \fBcurl\fR(1) (which disables the use of \fBcurlrc\fR)\.
.
.TP
\fBHOMEBREW_CURL_VERBOSE\fR
If set, Homebrew will pass \fB\-\-verbose\fR when invoking \fBcurl\fR(1)\.
.