Don't mess with stdout when writing build config to a file
This commit is contained in:
parent
a9c5e81a48
commit
c0579443f2
@ -91,39 +91,34 @@ module Homebrew
|
||||
end
|
||||
|
||||
# we try to keep output minimal
|
||||
def dump_build_config
|
||||
puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}"
|
||||
puts "HEAD: #{head}"
|
||||
puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" if HOMEBREW_PREFIX.to_s != "/usr/local"
|
||||
puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar"
|
||||
puts hardware
|
||||
puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}"
|
||||
puts "Xcode: #{xcode}" if xcode
|
||||
puts "CLT: #{clt}" if clt
|
||||
def dump_build_config(f)
|
||||
f.puts "HOMEBREW_VERSION: #{HOMEBREW_VERSION}"
|
||||
f.puts "HEAD: #{head}"
|
||||
f.puts "HOMEBREW_PREFIX: #{HOMEBREW_PREFIX}" if HOMEBREW_PREFIX.to_s != "/usr/local"
|
||||
f.puts "HOMEBREW_CELLAR: #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.to_s != "#{HOMEBREW_PREFIX}/Cellar"
|
||||
f.puts hardware
|
||||
f.puts "OS X: #{MACOS_FULL_VERSION}-#{kernel}"
|
||||
f.puts "Xcode: #{xcode}" if xcode
|
||||
f.puts "CLT: #{clt}" if clt
|
||||
|
||||
ruby_version = MacOS.version >= "10.9" ? "2.0" : "1.8"
|
||||
if RUBY_VERSION[/\d\.\d/] != ruby_version
|
||||
puts "#{RUBY_PATH}:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}"
|
||||
f.puts "#{RUBY_PATH}:\n #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}"
|
||||
end
|
||||
|
||||
unless MacOS.compilers_standard?
|
||||
puts "GCC-4.0: build #{gcc_40}" if gcc_40
|
||||
puts "GCC-4.2: build #{gcc_42}" if gcc_42
|
||||
puts "LLVM-GCC: build #{llvm}" if llvm
|
||||
puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}"
|
||||
f.puts "GCC-4.0: build #{gcc_40}" if gcc_40
|
||||
f.puts "GCC-4.2: build #{gcc_42}" if gcc_42
|
||||
f.puts "LLVM-GCC: build #{llvm}" if llvm
|
||||
f.puts "Clang: #{clang ? "#{clang} build #{clang_build}" : "N/A"}"
|
||||
end
|
||||
|
||||
puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink
|
||||
|
||||
puts "X11: #{describe_x11}"
|
||||
f.puts "MacPorts/Fink: #{macports_or_fink}" if macports_or_fink
|
||||
f.puts "X11: #{describe_x11}"
|
||||
end
|
||||
|
||||
def write_build_config f
|
||||
stdout = $stdout
|
||||
$stdout = f
|
||||
Homebrew.dump_build_config
|
||||
ensure
|
||||
$stdout = stdout
|
||||
def write_build_config(f)
|
||||
Homebrew.dump_build_config(f)
|
||||
end
|
||||
|
||||
def dump_verbose_config
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user