aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMike McQuaid2015-12-25 22:42:00 +0000
committerMike McQuaid2016-01-17 19:39:41 +0000
commiteffca7d9c60495f7c5c21af637da4e0e2952f66e (patch)
tree7048f4dd2808e9f538df398f4cddf786c7cce676 /bin
parent3e0828c29a6c0d68d61931c7f68e9555bf7e7ede (diff)
downloadbrew-effca7d9c60495f7c5c21af637da4e0e2952f66e.tar.bz2
bin/brew: set more HOMEBREW_* env from Bash.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew17
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/brew b/bin/brew
index 0503abc09..30d4f9c49 100755
--- a/bin/brew
+++ b/bin/brew
@@ -21,7 +21,18 @@ then
chdir "$BREW_SYMLINK_DIRECTORY" && pwd -P)"
fi
-BREW_LIBRARY_DIRECTORY="$(chdir "$BREW_FILE_DIRECTORY"/../Library && pwd -P)"
+HOMEBREW_PREFIX="$(chdir "$(dirname "$(dirname "$HOMEBREW_BREW_FILE")")" && pwd -P)"
+HOMEBREW_REPOSITORY="$(chdir "$BREW_FILE_DIRECTORY"/../ && pwd -P)"
+HOMEBREW_LIBRARY="$(chdir "$BREW_FILE_DIRECTORY"/../Library && pwd -P)"
+
+# Where we store built products; /usr/local/Cellar if it exists,
+# otherwise a Cellar relative to the Repository.
+if [ -d "$HOMEBREW_PREFIX/Cellar" ]
+then
+ HOMEBREW_CELLAR="$HOMEBREW_PREFIX/Cellar"
+else
+ HOMEBREW_CELLAR="$HOMEBREW_REPOSITORY/Cellar"
+fi
# Users may have these set, pointing the system Ruby
# at non-system gem paths
@@ -45,5 +56,9 @@ fi
export HOMEBREW_BREW_FILE
export HOMEBREW_RUBY_PATH
+export HOMEBREW_PREFIX
+export HOMEBREW_REPOSITORY
+export HOMEBREW_LIBRARY
+export HOMEBREW_CELLAR
exec "$HOMEBREW_RUBY_PATH" -W0 "$BREW_LIBRARY_DIRECTORY/brew.rb" "$@"