Promote log stream to a local
This commit is contained in:
parent
479ad0265b
commit
effddda4f9
@ -514,33 +514,32 @@ class Formula
|
|||||||
pid = fork { exec_cmd(cmd, args, rd, wr, logfn) }
|
pid = fork { exec_cmd(cmd, args, rd, wr, logfn) }
|
||||||
wr.close
|
wr.close
|
||||||
|
|
||||||
File.open(logfn, 'w') do |f|
|
log = File.open(logfn, "w")
|
||||||
f.puts Time.now, "", cmd, args, ""
|
log.puts Time.now, "", cmd, args, ""
|
||||||
|
|
||||||
if ARGV.verbose?
|
if ARGV.verbose?
|
||||||
while buf = rd.gets
|
while buf = rd.gets
|
||||||
f.puts buf
|
log.puts buf
|
||||||
puts buf
|
puts buf
|
||||||
end
|
|
||||||
elsif IO.respond_to?(:copy_stream)
|
|
||||||
IO.copy_stream(rd, f)
|
|
||||||
else
|
|
||||||
buf = ""
|
|
||||||
f.write(buf) while rd.read(1024, buf)
|
|
||||||
end
|
end
|
||||||
|
elsif IO.respond_to?(:copy_stream)
|
||||||
|
IO.copy_stream(rd, log)
|
||||||
|
else
|
||||||
|
buf = ""
|
||||||
|
log.write(buf) while rd.read(1024, buf)
|
||||||
|
end
|
||||||
|
|
||||||
Process.wait(pid)
|
Process.wait(pid)
|
||||||
|
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
|
|
||||||
unless $?.success?
|
unless $?.success?
|
||||||
f.flush
|
log.flush
|
||||||
Kernel.system "/usr/bin/tail", "-n", "5", logfn unless ARGV.verbose?
|
Kernel.system "/usr/bin/tail", "-n", "5", logfn unless ARGV.verbose?
|
||||||
f.puts
|
log.puts
|
||||||
require 'cmd/config'
|
require 'cmd/config'
|
||||||
Homebrew.dump_build_config(f)
|
Homebrew.dump_build_config(log)
|
||||||
raise BuildError.new(self, cmd, args)
|
raise BuildError.new(self, cmd, args)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
rd.close unless rd.closed?
|
rd.close unless rd.closed?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user