aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorSamuel John2013-09-03 10:46:06 +0200
committerSamuel John2013-09-03 10:46:06 +0200
commitd2fea17e176eb06f41b8688484113b13485179e1 (patch)
treeac3d1bd721434828f1cb856bcb27c8d070f1d347 /Library/Homebrew/cmd
parent9f7c616c1cb7b2301e790dde56fc2ce0107c39de (diff)
downloadhomebrew-d2fea17e176eb06f41b8688484113b13485179e1.tar.bz2
PythonInstalled: Allow formulae to set/append PYTHONPATH
Improve robustness of `PYTHONPATH` by first unsetting it (during `satisfy`) so that the `PythonInstalled` can get the `python.version` and so forth and then, after that, setting the `PYTHONPATH` to our `global_site_packages`. In the `python_helper` we append to the `PYTHONPATH` so if that var has been set in a formula, it is respected. Brew audit does no longer complain about setting the `ENV['PYTHONPATH']`.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 824d1ed69..0fca0b4af 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -568,13 +568,7 @@ class FormulaAuditor
end
end
- if f.requirements.any?{ |r| r.kind_of?(PythonInstalled) }
- # Don't check this for all formulae, because some are allowed to set the
- # PYTHONPATH. E.g. python.rb itself needs to set it.
- if text =~ /ENV\.append.*PYTHONPATH/ || text =~ /ENV\[['"]PYTHONPATH['"]\]\s*=[^=]/
- problem "Don't set the PYTHONPATH, instead declare `depends_on :python`"
- end
- else
+ unless f.requirements.any?{ |r| r.kind_of?(PythonInstalled) }
# So if there is no PythonInstalled requirement, we can check if the
# formula still uses python and should add a `depends_on :python`
unless f.name.to_s =~ /(pypy[0-9]*)|(python[0-9]*)/