From 28f89c59a2b39738df5a6fc85711be9af250fb53 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 13 May 2012 18:40:04 -0500 Subject: [PATCH] FormulaInstaller: fold dirlist helper into check_m4 Having in_aclocal_dirlist? defined as a method on FormulaInstaller is a little weird; since its just a return condition of check_m4, move the code there. Signed-off-by: Jack Nagel --- Library/Homebrew/formula_installer.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index db893e2ad6..22a9dd8142 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -273,12 +273,6 @@ 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| @@ -385,8 +379,12 @@ class FormulaInstaller def check_m4 return if MacOS.xcode_version.to_f >= 4.3 + return if File.open("/usr/share/aclocal/dirlist") do |dirlist| + dirlist.grep(%r{^#{HOMEBREW_PREFIX}/share/aclocal$}).length > 0 + end rescue false + # Check for m4 files - if Dir[f.share+"aclocal/*.m4"].length > 0 and not in_aclocal_dirlist? + if Dir[f.share+"aclocal/*.m4"].length > 0 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"