From 607be5e711006c3b0747ec2b9ef29dd03f53a959 Mon Sep 17 00:00:00 2001 From: Alex Dunn Date: Sun, 5 Jul 2015 14:15:19 -0700 Subject: [PATCH] formula_cellar_checks: check_site_lisp() --- Library/Homebrew/formula_cellar_checks.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index 771fa79cf2..f16750b150 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -173,6 +173,26 @@ module FormulaCellarChecks EOS end + def check_emacs_lisp(share, name) + return unless share.directory? + + # Emacs itself can do what it wants + return if name == "emacs" + + elisps = (share/"emacs/site-lisp").children.select { |file| %w[.el .elc].include? file.extname } + return if elisps.empty? + + <<-EOS.undent + Emacs Lisp files were linked directly to #{HOMEBREW_PREFIX}/share/emacs/site-lisp + + This may cause conflicts with other packages; install to a subdirectory instead, such as + #{share}/emacs/site-lisp/#{name} + + The offending files are: + #{elisps * "\n "} + EOS + end + def audit_installed audit_check_output(check_manpages) audit_check_output(check_infopages) @@ -186,6 +206,7 @@ module FormulaCellarChecks audit_check_output(check_easy_install_pth(formula.lib)) audit_check_output(check_openssl_links) audit_check_output(check_python_framework_links(formula.lib)) + audit_check_output(check_emacs_lisp(formula.share,formula.name)) end private