From 8b4645d895e6d998e56603dcd05362e20df0ac71 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 19 Mar 2011 09:14:59 -0700 Subject: [PATCH] Use backticks instead of popen Using popen here breaks brew install -v due to the way the error pipe is passed around during install. --- Library/Homebrew/utils.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 5b43480800..072e8fd116 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -153,7 +153,8 @@ 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 -L #{cmd}").readlines.inject([]) do |archs, line| + lines = `/usr/bin/file -L #{cmd}` + archs = lines.to_a.inject([]) do |archs, line| case line when /Mach-O (executable|dynamically linked shared library) ppc/ archs << :ppc7400