aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorTim D. Smith2014-10-01 18:40:04 -0700
committerTim D. Smith2014-10-02 11:58:13 -0700
commit9134718f9caca3b029e8cc538497fd8a61b77551 (patch)
tree7f2c32ff5ec397188beb5c48b78b039346200967 /Library
parentf2fa5512913e7904b3f2c26e8ec66a2bb7595604 (diff)
downloadbrew-9134718f9caca3b029e8cc538497fd8a61b77551.tar.bz2
Audit formulæ for easy-install.pth files
Closes Homebrew/homebrew#32860.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb1
-rw-r--r--Library/Homebrew/formula_cellar_checks.rb13
2 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index cbfb67dce..e7e3868a4 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -568,6 +568,7 @@ class FormulaAuditor
audit_check_output(check_non_executables(f.sbin))
audit_check_output(check_generic_executables(f.sbin))
audit_check_output(check_shadowed_headers)
+ audit_check_output(check_easy_install_pth(f.lib))
end
def audit
diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb
index f639c2046..372fcca87 100644
--- a/Library/Homebrew/formula_cellar_checks.rb
+++ b/Library/Homebrew/formula_cellar_checks.rb
@@ -120,6 +120,19 @@ module FormulaCellarChecks
"The offending files are: \n #{files * "\n "}"]
end
+ def check_easy_install_pth lib
+ pth_found = Dir["#{lib}/python{2.7,3.4}/site-packages/easy-install.pth"].map { |f| File.dirname(f) }
+ return if pth_found.empty?
+
+ ["easy-install.pth files were found in #{pth_found.join(", ")}.",
+ <<-EOS.undent
+ These .pth files are likely to cause link conflicts. Please
+ invoke setup.py with options --single-version-externally-managed
+ --record=install.txt.
+ EOS
+ ]
+ end
+
private
def relative_glob(dir, pattern)