archs_for_command now follows symlinks.

Tell file(1) to follow symlinks using the -L option.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
James Harris 2010-08-02 11:28:21 -05:00 committed by Adam Vandenberg
parent bc82bfc6d5
commit 07ce6d6e16

View File

@ -177,7 +177,7 @@ def archs_for_command cmd
cmd = `/usr/bin/which #{cmd}` unless Pathname.new(cmd).absolute?
cmd.gsub! ' ', '\\ ' # Escape spaces in the filename.
archs = IO.popen("/usr/bin/file #{cmd}").readlines.inject([]) do |archs, line|
archs = IO.popen("/usr/bin/file -L #{cmd}").readlines.inject([]) do |archs, line|
case line
when /Mach-O (executable|dynamically linked shared library) ppc/
archs << :ppc7400