diff options
| author | Max Howell | 2011-02-13 13:50:44 +0000 |
|---|---|---|
| committer | Adam Vandenberg | 2011-03-12 11:55:07 -0800 |
| commit | 8ace9f0294ad488bf7236b9d4fb206244a09c445 (patch) | |
| tree | 1bcdcf1f26e9367a65cb61f39643f54e56bdac6a | |
| parent | 2ca7bb0228196636208e1cd76eb50ddd20d3248c (diff) | |
| download | homebrew-8ace9f0294ad488bf7236b9d4fb206244a09c445.tar.bz2 | |
Add comment and use constants
| -rwxr-xr-x | Library/Homebrew/install.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index fcf35953f..4746ac5f4 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -50,14 +50,14 @@ at_exit do end end +ORIGINAL_PATHS = ENV['PATH'].split(':').map{ |p| File.expand_path p } +HOMEBREW_BIN = (HOMEBREW_PREFIX+'bin').to_s + def install f show_summary_heading = false - paths = ENV['PATH'].split(':').map{ |p| File.expand_path p } - rootbin = (HOMEBREW_PREFIX+'bin').to_s - unless paths.include? rootbin - ENV.prepend 'PATH', rootbin, ':' - end + # we must do this or tools like pkg-config won't get found by configure scripts etc. + ENV.prepend 'PATH', HOMEBREW_BIN, ':' unless ORIGINAL_PATHS.include? HOMEBREW_BIN f.deps.uniq.each do |dep| dep = Formula.factory dep @@ -157,10 +157,9 @@ def install f # warn the user if stuff was installed outside of their PATH [f.bin, f.sbin].each do |bin| if bin.directory? - rootbin = (HOMEBREW_PREFIX/bin.basename).to_s bin = File.expand_path bin - unless paths.include? rootbin - opoo "#{rootbin} is not in your PATH" + unless ORIGINAL_PATHS.include? HOMEBREW_BIN + opoo "#{HOMEBREW_BIN} is not in your PATH" puts "You can amend this by altering your ~/.bashrc file" show_summary_heading = true end |
