Set ENV[HOMEBREW_BREW_FILE]

Thus install.rb gets the path to the instantiating brew process rather than whichever is first in the PATH. Not to mention Homebrew doesn't *have* to be in the PATH.
This commit is contained in:
Max Howell 2009-11-07 18:09:48 +00:00
parent 6b18d5572d
commit 86516e563f
3 changed files with 5 additions and 2 deletions

View File

@ -38,6 +38,10 @@ else
HOMEBREW_CACHE=Pathname.new("~/Library/Caches/Homebrew").expand_path
end
if not defined? HOMEBREW_BREW_FILE
HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] or `which brew`.chomp
end
HOMEBREW_PREFIX = Pathname.new(HOMEBREW_BREW_FILE).dirname.parent # Where we link under
HOMEBREW_REPOSITORY = Pathname.new(HOMEBREW_BREW_FILE).realpath.dirname.parent # Where .git is found

View File

@ -1,6 +1,4 @@
#!/usr/bin/ruby
HOMEBREW_BREW_FILE = `which brew`.strip
require 'global'
def text_for_keg_only_formula f

View File

@ -6,6 +6,7 @@
Dir.getwd rescue abort "The current working directory doesn't exist, cannot proceed."
HOMEBREW_BREW_FILE = File.expand_path __FILE__
ENV['HOMEBREW_BREW_FILE'] = HOMEBREW_BREW_FILE
def homebrew_rubylib_path
lib_path = "/../../Library/Homebrew"