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
commitc524ffe9ba4a2bc27186b1a9b8c3ecdcfaf0da66 (patch)
treef1f7cfe3ec17a14d133ce09b900bc18461350db1 /Library/Homebrew/cmd
parent2f50e5a09a26234c194cd6922ac2cf44084da004 (diff)
downloadhomebrew-c524ffe9ba4a2bc27186b1a9b8c3ecdcfaf0da66.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'