aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel John2013-08-08 11:48:16 +0200
committerSamuel John2013-08-08 11:48:16 +0200
commit72dfc1b5c0513f33f90d7f2987bcc9e8843b9de8 (patch)
tree865cacd87173382cb29247543c74be92f0d12067
parenta9f5eb3f93b0e6957cc479ae484451ddae2d2d27 (diff)
downloadhomebrew-72dfc1b5c0513f33f90d7f2987bcc9e8843b9de8.tar.bz2
python_helper prepends PYTHONPATH
…instead of appending. This should be safer against any malformed user-defined values in the PYTHONPATH.
-rw-r--r--Library/Homebrew/python_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/python_helper.rb b/Library/Homebrew/python_helper.rb
index b121ca5d7..3fd501bb2 100644
--- a/Library/Homebrew/python_helper.rb
+++ b/Library/Homebrew/python_helper.rb
@@ -1,4 +1,4 @@
-# This is used in the Formula class when the user calls
+# This helper method is used in the Formula class when the user calls
# `python`, `python2` or `python3`.
# This method has a dual nature. For one, it takes a &block and sets up
@@ -65,9 +65,9 @@ def python_helper(options={:allowed_major_versions => [2, 3]}, &block)
# In order to install into the Cellar, the dir must exist and be in the
# PYTHONPATH. This will be executed in the context of the formula
# so that lib points to the HOMEBREW_PREFIX/Cellar/<formula>/<version>/lib
- puts "brew: Appending to PYTHONPATH: #{py.site_packages}" if ARGV.verbose?
+ puts "brew: Prepending to PYTHONPATH: #{py.site_packages}" if ARGV.verbose?
mkdir_p py.site_packages
- ENV.append 'PYTHONPATH', py.site_packages, ':'
+ ENV.prepend 'PYTHONPATH', py.site_packages, ':'
ENV['PYTHON'] = py.binary
ENV.prepend 'CMAKE_INCLUDE_PATH', py.incdir, ':'
ENV.prepend 'PKG_CONFIG_PATH', py.pkg_config_path, ':' if py.pkg_config_path