Reduce branches and effective scope of some variables
This commit is contained in:
parent
34ea00783c
commit
a3409a179e
@ -513,25 +513,24 @@ class Formula
|
||||
|
||||
if ARGV.verbose?
|
||||
rd, wr = IO.pipe
|
||||
out = wr
|
||||
else
|
||||
out = log
|
||||
end
|
||||
|
||||
begin
|
||||
pid = fork do
|
||||
if rd
|
||||
rd.close
|
||||
log.close
|
||||
exec_cmd(cmd, args, wr, logfn)
|
||||
end
|
||||
exec_cmd(cmd, args, out, logfn)
|
||||
end
|
||||
wr.close if wr
|
||||
wr.close
|
||||
|
||||
while buf = rd.gets
|
||||
log.puts buf
|
||||
puts buf
|
||||
end if rd
|
||||
end
|
||||
ensure
|
||||
rd.close unless rd.closed?
|
||||
end
|
||||
else
|
||||
pid = fork { exec_cmd(cmd, args, log, logfn) }
|
||||
end
|
||||
|
||||
Process.wait(pid)
|
||||
|
||||
@ -545,9 +544,6 @@ class Formula
|
||||
Homebrew.dump_build_config(log)
|
||||
raise BuildError.new(self, cmd, args)
|
||||
end
|
||||
ensure
|
||||
rd.close if rd && !rd.closed?
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user