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 <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-05-13 18:40:04 -05:00
parent 71d34a86d6
commit 28f89c59a2

View File

@ -273,12 +273,6 @@ class FormulaInstaller
@paths ||= ENV['PATH'].split(':').map{ |p| File.expand_path p } @paths ||= ENV['PATH'].split(':').map{ |p| File.expand_path p }
end 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 def check_PATH
# warn the user if stuff was installed outside of their PATH # warn the user if stuff was installed outside of their PATH
[f.bin, f.sbin].each do |bin| [f.bin, f.sbin].each do |bin|
@ -385,8 +379,12 @@ class FormulaInstaller
def check_m4 def check_m4
return if MacOS.xcode_version.to_f >= 4.3 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 # 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".' opoo 'm4 macros were installed to "share/aclocal".'
puts "Homebrew does not append \"#{HOMEBREW_PREFIX}/share/aclocal\"" puts "Homebrew does not append \"#{HOMEBREW_PREFIX}/share/aclocal\""
puts "to \"/usr/share/aclocal/dirlist\". If an autoconf script you use" puts "to \"/usr/share/aclocal/dirlist\". If an autoconf script you use"