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:
Mike McQuaid 2022-07-22 14:39:21 +01:00
parent fad20859b1
commit 0f54f342e6
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829

View File

@ -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