This commit is contained in:
Doug Hazell 2016-12-30 19:46:29 +00:00
parent eca3f117ba
commit 90b3f9b19a
2 changed files with 17 additions and 6 deletions

View File

@ -76,7 +76,11 @@ export GEM_OLD_PATH="$GEM_PATH"
# Users may have these set, pointing the system Ruby # Users may have these set, pointing the system Ruby
# at non-system gem paths # at non-system gem paths
unset GEM_HOME unset GEM_HOME
unset GEM_PATH
if [[ -z "$HOMEBREW_WHICH_RUBY" ]]
then
unset GEM_PATH
fi
# Users may have this set, injecting arbitrary environment changes into # Users may have this set, injecting arbitrary environment changes into
# bash processes inside builds # bash processes inside builds
@ -267,6 +271,12 @@ access to all bottles."
EOS EOS
fi fi
if [[ -z "$HOMEBREW_ENV_PRUNED" ]]
then
source "$HOMEBREW_LIBRARY/Homebrew/utils/shell_env.sh"
prune-shell-env
fi
# Hide shellcheck complaint: # Hide shellcheck complaint:
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh" source "$HOMEBREW_LIBRARY/Homebrew/utils/analytics.sh"
@ -337,6 +347,11 @@ else
source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh" source "$HOMEBREW_LIBRARY/Homebrew/utils/ruby.sh"
setup-ruby-path setup-ruby-path
if [[ -n "$HOMEBREW_WHICH_RUBY" ]]
then
export HOMEBREW_RUBY_PATH="$(which ruby)"
fi
# Unshift command back into argument list (unless argument list was empty). # Unshift command back into argument list (unless argument list was empty).
[[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@" [[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@"
{ update-preinstall; exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/Homebrew/brew.rb" "$@"; } { update-preinstall; exec "$HOMEBREW_RUBY_PATH" -W0 "$HOMEBREW_LIBRARY/Homebrew/brew.rb" "$@"; }

View File

@ -113,13 +113,9 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
if [[ -n "$HOMEBREW_ENV_FILTERING" ]] if [[ -n "$HOMEBREW_ENV_FILTERING" ]]
then then
echo "----- HOMEBREW_ENV_FILTERING set -----"
# Needed TERM to prevent "tput: No value for $TERM and no -T specified" # Needed TERM to prevent "tput: No value for $TERM and no -T specified"
env | grep -E '^(HOMEBREW.*|HOME|PATH|TERM)=.*$' > /tmp/homebrew-env env | grep -E '^(HOMEBREW.*|HOME|PATH|TERM)=.*$' > /tmp/homebrew-env
env -i "$HOMEBREW_LIBRARY/Homebrew/utils/shell_env.sh" "$@" env -i "$HOMEBREW_LIBRARY/Homebrew/utils/shell_env.sh" "$@"
else else
echo "----- HOMEBREW_ENV_FILTERING NOT set! -----"
source "$HOMEBREW_LIBRARY/Homebrew/brew.sh" source "$HOMEBREW_LIBRARY/Homebrew/brew.sh"
fi fi