aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDoug Hazell2017-02-19 02:12:46 +0000
committerDoug Hazell2017-02-19 02:12:46 +0000
commit5d1576784a5603662ca9910eb97c948e833f35c9 (patch)
tree76554a8122b5863a138d8feb4e6a0da82f318efc /bin
parentadc43466a6c3d807344e0350e8d1776c4bd78a31 (diff)
downloadbrew-5d1576784a5603662ca9910eb97c948e833f35c9.tar.bz2
Mechanism to dynamically add HOMEBREW.* vars to 'env -i' command string in 'bin/brew'
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew23
1 files changed, 15 insertions, 8 deletions
diff --git a/bin/brew b/bin/brew
index b5fb9af04..710ef7e5c 100755
--- a/bin/brew
+++ b/bin/brew
@@ -46,15 +46,22 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
if [[ -n "$HOMEBREW_ENV_FILTERING" ]]
then
- env -i \
- HOME="$HOME" \
+
+ homebrew_vars=$("$HOMEBREW_LIBRARY/Homebrew/utils/homebrew_vars.rb")
+
+ cmd_str="/usr/bin/env -i \
+ HOME=$HOME \
PATH=/usr/bin:/bin:/usr/sbin:/sbin \
- TERM="$TERM" \
- HOMEBREW_BREW_FILE="$HOMEBREW_BREW_FILE" \
- HOMEBREW_PREFIX="$HOMEBREW_PREFIX" \
- HOMEBREW_REPOSITORY="$HOMEBREW_REPOSITORY" \
- HOMEBREW_LIBRARY="$HOMEBREW_LIBRARY" \
- /bin/bash "$HOMEBREW_LIBRARY/Homebrew/brew.sh" "$@"
+ TERM=$TERM \
+ HOMEBREW_BREW_FILE=$HOMEBREW_BREW_FILE \
+ HOMEBREW_PREFIX=$HOMEBREW_PREFIX \
+ HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY \
+ HOMEBREW_LIBRARY=$HOMEBREW_LIBRARY \
+ $homebrew_vars \
+ /bin/bash $HOMEBREW_LIBRARY/Homebrew/brew.sh $@"
+
+ command $cmd_str
+
else
source "$HOMEBREW_LIBRARY/Homebrew/brew.sh"
fi