Skip to content

Commit

Permalink
Allow CURL_HOME env var when HOMEBREW_CURLRC is set
Browse files Browse the repository at this point in the history
  • Loading branch information
clint-stripe committed Aug 10, 2023
1 parent 237d1e7 commit 726f1ea
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Library/Homebrew/env_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ module EnvConfig
"use of `curlrc`.",
boolean: true,
},
HOMEBREW_CURL_HOME: {
description: "If set alongside `HOMEBREW_CURLRC`, `curl`(1) will be invoked with `CURL_HOME` " \
"set to this directory.",
},
HOMEBREW_DEBUG: {
description: "If set, always assume `--debug` when running commands.",
boolean: true,
Expand Down
7 changes: 7 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ ENV_VAR_NAMES=(
HOME SHELL PATH TERM TERMINFO TERMINFO_DIRS COLUMNS DISPLAY LOGNAME USER CI SSH_AUTH_SOCK SUDO_ASKPASS
http_proxy https_proxy ftp_proxy no_proxy all_proxy HTTPS_PROXY FTP_PROXY ALL_PROXY
)

# When using .curlrc is permitted, also allow setting CURL_HOME
if [[ -n "${HOMEBREW_CURLRC-}" && -n "${HOMEBREW_CURL_HOME-}" ]]
then
FILTERED_ENV+=("CURL_HOME=${HOMEBREW_CURL_HOME}")
fi

# Filter all but the specific variables.
for VAR in "${ENV_VAR_NAMES[@]}" "${!HOMEBREW_@}"
do
Expand Down
3 changes: 3 additions & 0 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2172,6 +2172,9 @@ prefix-specific files take precedence over system-wide files (unless
- `HOMEBREW_CURLRC`
<br>If set, do not pass `--disable` when invoking `curl`(1), which disables the use of `curlrc`.

- `HOMEBREW_CURL_HOME`
<br>If set alongside `HOMEBREW_CURLRC`, `curl`(1) will be invoked with `CURL_HOME` set to this directory.

- `HOMEBREW_DEBUG`
<br>If set, always assume `--debug` when running commands.

Expand Down
6 changes: 6 additions & 0 deletions manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -3140,6 +3140,12 @@ If set, pass \fB\-\-verbose\fR when invoking \fBcurl\fR(1)\.
If set, do not pass \fB\-\-disable\fR when invoking \fBcurl\fR(1), which disables the use of \fBcurlrc\fR\.
.
.TP
\fBHOMEBREW_CURL_HOME\fR
.
.br
If set alongside \fBHOMEBREW_CURLRC\fR, \fBcurl\fR(1) will be invoked with \fBCURL_HOME\fR set to this directory\.
.
.TP
\fBHOMEBREW_DEBUG\fR
.
.br
Expand Down

0 comments on commit 726f1ea

Please sign in to comment.