mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
bin/brew: remove HOMEBREW_NO_ENV_FILTERING.
It's been deprecated for a long time. Add a disabling message to be nice (that we'll remove in future).
This commit is contained in:
parent
fad20859b1
commit
0f54f342e6
19
bin/brew
19
bin/brew
@ -18,6 +18,15 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Fail fast with concise message when requesting unfiltered environment.
|
||||||
|
# This is basically odisabled so can be removed at any major release afterwards
|
||||||
|
# and definitely if this is still here in 2023.
|
||||||
|
if [ -n "${HOMEBREW_NO_ENV_FILTERING}" ]
|
||||||
|
then
|
||||||
|
echo "Error: HOMEBREW_NO_ENV_FILTERING was deprecated for over a year and has now been removed (because it breaks many things)!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
quiet_cd() {
|
quiet_cd() {
|
||||||
cd "$@" &>/dev/null || return
|
cd "$@" &>/dev/null || return
|
||||||
}
|
}
|
||||||
@ -114,10 +123,7 @@ fi
|
|||||||
HOMEBREW_PATH="${PATH}"
|
HOMEBREW_PATH="${PATH}"
|
||||||
export HOMEBREW_PATH
|
export HOMEBREW_PATH
|
||||||
|
|
||||||
# set from user environment
|
# filter the user environment
|
||||||
# shellcheck disable=SC2154
|
|
||||||
if [[ -z "${HOMEBREW_NO_ENV_FILTERING}" ]]
|
|
||||||
then
|
|
||||||
PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
||||||
|
|
||||||
FILTERED_ENV=()
|
FILTERED_ENV=()
|
||||||
@ -138,8 +144,3 @@ then
|
|||||||
unset VAR ENV_VAR_NAMES
|
unset VAR ENV_VAR_NAMES
|
||||||
|
|
||||||
exec /usr/bin/env -i "${FILTERED_ENV[@]}" /bin/bash "${HOMEBREW_LIBRARY}/Homebrew/brew.sh" "$@"
|
exec /usr/bin/env -i "${FILTERED_ENV[@]}" /bin/bash "${HOMEBREW_LIBRARY}/Homebrew/brew.sh" "$@"
|
||||||
else
|
|
||||||
echo "Warning: HOMEBREW_NO_ENV_FILTERING is undocumented, deprecated and will be removed in a future Homebrew release (because it breaks many things)!" >&2
|
|
||||||
|
|
||||||
source "${HOMEBREW_LIBRARY}/Homebrew/brew.sh"
|
|
||||||
fi
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user