From 6012e29986f6b9806477889e858980baee43d6a2 Mon Sep 17 00:00:00 2001 From: Felix Buenemann Date: Wed, 16 Nov 2011 22:44:38 +0100 Subject: [PATCH] Omit check_m4 warning when appropriate If the suggested modifications are already in place, just skip the warning. Closes Homebrew/homebrew#8624. Signed-off-by: Jack Nagel --- Library/Homebrew/formula_installer.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index e6d846dd12..c2c04c8f3d 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -202,6 +202,12 @@ class FormulaInstaller @paths ||= ENV['PATH'].split(':').map{ |p| File.expand_path p } end + def in_aclocal_dirlist? + File.open("/usr/share/aclocal/dirlist") do |dirlist| + dirlist.grep(%r{^#{HOMEBREW_PREFIX}/share/aclocal$}).length > 0 + end rescue false + end + def check_PATH # warn the user if stuff was installed outside of their PATH [f.bin, f.sbin].each do |bin| @@ -252,7 +258,7 @@ class FormulaInstaller def check_m4 # Check for m4 files - if Dir[f.share+"aclocal/*.m4"].length > 0 + if Dir[f.share+"aclocal/*.m4"].length > 0 and not in_aclocal_dirlist? opoo 'm4 macros were installed to "share/aclocal".' puts "Homebrew does not append \"#{HOMEBREW_PREFIX}/share/aclocal\"" puts "to \"/usr/share/aclocal/dirlist\". If an autoconf script you use"