diff options
| -rw-r--r-- | Library/Homebrew/caveats.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index 75746a8d2..26cb4cee4 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -46,17 +46,22 @@ class Caveats end def python_caveats + return unless keg + return unless keg.python_site_packages_installed? + return if Formula["python"].installed? site_packages = if f.keg_only? "#{f.opt_prefix}/lib/python2.7/site-packages" else "#{HOMEBREW_PREFIX}/lib/python2.7/site-packages" end - if keg and keg.python_site_packages_installed? \ - and !ENV['PYTHONPATH'].to_s.include? site_packages - <<-EOS.undent - Set PYTHONPATH if you need Python to find the installed site-packages: - export PYTHONPATH=#{site_packages}:$PYTHONPATH - EOS + dir = "~/Library/Python/2.7/lib/python/site-packages" + dir_path = Pathname.new(dir).expand_path + file = "#{dir}/homebrew.pth" + file_path = Pathname.new(file).expand_path + if !file_path.readable? || !file_path.read.include?(site_packages) + s = "If you need Python to find the installed site-packages:\n" + s += " mkdir -p #{dir}\n" unless dir_path.exist? + s += " echo '#{site_packages}' >> #{file}" end end |
