aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMax Howell2012-09-23 21:06:09 -0400
committerMax Howell2012-09-23 21:26:50 -0400
commitbcf0d6f2450cdea84a32f9a844307804f542fc21 (patch)
tree1591c01a7fbfd6e69c6c2370bdc3ebf54db73028 /Library/Homebrew/cmd
parenta0df6180b7c99f7cb78493bd1c103012e3e328b1 (diff)
downloadbrew-bcf0d6f2450cdea84a32f9a844307804f542fc21.tar.bz2
superenv: Remove HOMEBREW_PREFIX/bin from PATH
We add the bins from all deps instead. Rationale: formula find and use eg. GNU-coreutils versions of things and then break. Only allow formula to use tools that they depend on and expect. I want to go further and only add include paths etc. for dependencies, I have done some work on this, but I fear it may be impossible. If an include path is eg. /usr/local/lib/foo/include, is it possible to know if this path is bad? Not always AFAICT.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/sh.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/sh.rb b/Library/Homebrew/cmd/sh.rb
index eca214e34..956cc4ecd 100644
--- a/Library/Homebrew/cmd/sh.rb
+++ b/Library/Homebrew/cmd/sh.rb
@@ -8,6 +8,10 @@ module Homebrew extend self
ENV.deps = Formula.installed.select{|f| f.keg_only? and f.opt_prefix.directory? }.map(&:name)
end
ENV.setup_build_environment
+ if superenv?
+ # superenv stopped adding brew's bin but generally user's will want it
+ ENV['PATH'] = ENV['PATH'].split(':').insert(1, "#{HOMEBREW_PREFIX}/bin").join(':')
+ end
ENV['PS1'] = 'brew \[\033[1;32m\]\w\[\033[0m\]$ '
ENV['VERBOSE'] = '1'
ENV['HOMEBREW_LOG'] = '1'