aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2009-10-27 13:27:36 -0700
committerMax Howell2009-11-04 16:27:36 +0000
commitc76d652da2ba8baa7718a9a6fe631d79a5e98ff0 (patch)
treec96ef33d929011dcc43470455c8d7e762b3aff25 /Library
parent3087888fb0d57fd812faa484fb234c5b748b87a6 (diff)
downloadbrew-c76d652da2ba8baa7718a9a6fe631d79a5e98ff0.tar.bz2
Tweak code to locate Cellar path.
I think this tweak to finding the Cellar path addresses one of mxcl's concerns over supported install scenarios.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/global.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 07c5f315c..1ad2963fb 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -41,7 +41,15 @@ end
HOMEBREW_PREFIX = Pathname.new(BREW_FILE).dirname.parent # Where we link under
HOMEBREW_REPOSITORY = Pathname.new(BREW_FILE).realpath.dirname.parent # Where .git is found
-HOMEBREW_CELLAR = HOMEBREW_REPOSITORY+'Cellar' # Where we build into
+
+# Where should be build to?
+# If /usr/local/Cellar exists, as a symlink or real folder, use that.
+# Otherwise, build into a Cellar in the Repo. folder.
+if (HOMEBREW_PREFIX+'Cellar').exist?
+ HOMEBREW_CELLAR = HOMEBREW_PREFIX+'Cellar'
+else
+ HOMEBREW_CELLAR = HOMEBREW_REPOSITORY+'Cellar'
+end
MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp
MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f