diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index a97b816c05..5a734a2db4 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -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 diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index a4854cc67c..638117044e 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -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). diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 4770dc03b7..5e2c1c98d8 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -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 diff --git a/docs/Manpage.md b/docs/Manpage.md index 8d0408d7ba..e75fdcda9a 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -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). diff --git a/manpages/brew-cask.1 b/manpages/brew-cask.1 index 6b32a90518..346c45d6a8 100644 --- a/manpages/brew-cask.1 +++ b/manpages/brew-cask.1 @@ -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 diff --git a/manpages/brew.1 b/manpages/brew.1 index 163b2e4560..69f0b31ab7 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -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)\. .