From 287cc0dc0273c3bddf034f03d893eee0b8cc81a5 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Wed, 30 Sep 2009 02:36:21 -0400 Subject: [PATCH] Determine the repo path in a symlink-friendly way. The Contributions/selflink.sh script does not symlink the .git directory, so 'brew update' will fail because the prefix (/usr/local/) is not a git repository. To determine the actual location of the git repo we can get the realpath of the Library (to expand any symlinks) and take the parent of that. --- Library/Homebrew/global.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 7276e87339..c4f1bb6983 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -35,11 +35,14 @@ else end HOMEBREW_PREFIX = (Pathname.getwd+__FILE__).dirname.parent.parent.cleanpath -HOMEBREW_REPOSITORY = HOMEBREW_PREFIX.realpath HOMEBREW_CELLAR = HOMEBREW_PREFIX+'Cellar' HOMEBREW_VERSION = 0.4 HOMEBREW_WWW = 'http://bit.ly/Homebrew' +# we use Library as we allow people to symlink their Homebrew into another +# directory so they can hack in one place and use it in another +HOMEBREW_REPOSITORY = (HOMEBREW_PREFIX+'Library').realpath.parent + MACOS_FULL_VERSION = `/usr/bin/sw_vers -productVersion`.chomp MACOS_VERSION = /(10\.\d+)(\.\d+)?/.match(MACOS_FULL_VERSION).captures.first.to_f