diff options
| author | Adam Vandenberg | 2011-03-19 09:14:59 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2011-03-19 09:14:59 -0700 |
| commit | 5d30ca731647a5707b3820d40767fed23974f026 (patch) | |
| tree | 70e75c497772ce4958cd791b5efdb4a2bacd0697 /Library/Homebrew/utils.rb | |
| parent | 51904f6b66023a42c1593eaf339c16ecf50807e8 (diff) | |
| download | homebrew-5d30ca731647a5707b3820d40767fed23974f026.tar.bz2 | |
Use backticks instead of popen
Using popen here breaks brew install -v due to the way
the error pipe is passed around during install.
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 5b4348080..072e8fd11 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 |
