From 3171ee9f834ff5e1f6af64b869a67227574689d8 Mon Sep 17 00:00:00 2001 From: Will Braswell Date: Wed, 4 Jul 2018 14:04:16 -0700 Subject: [PATCH] Perl CPAN Support, Frozen cpanm Command, Fix Broken I/O Handling In execmd(), Part 1 --- lib/fpm/util.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/fpm/util.rb b/lib/fpm/util.rb index 302706f4fd..da7ef18fcb 100644 --- a/lib/fpm/util.rb +++ b/lib/fpm/util.rb @@ -163,17 +163,19 @@ def execmd(*args) stdout_w.close; stderr_w.close logger.info("Process is running", :pid => process.pid) if block_given? +# if false # allows output & cures gcc/as hang, but re-introduces Inline::CPP interactive build hang args3 = [] args3.push(process) if opts[:process] args3.push(process.io.stdin) if opts[:stdin] - args3.push(stdout_r) if opts[:stdout] - args3.push(stderr_r) if opts[:stderr] +# args3.push(stdout_r) if opts[:stdout] +# args3.push(stderr_r) if opts[:stderr] yield(*args3) - process.io.stdin.close if opts[:stdin] and not process.io.stdin.closed? - stdout_r.close unless stdout_r.closed? - stderr_r.close unless stderr_r.closed? +# process.io.stdin.close if opts[:stdin] and not process.io.stdin.closed? +# stdout_r.close unless stdout_r.closed? +# stderr_r.close unless stderr_r.closed? + logger.pipe(stdout_r => :info, stderr_r => :info) else # Log both stdout and stderr as 'info' because nobody uses stderr for # actually reporting errors and as a result 'stderr' is a misnomer. @@ -249,9 +251,9 @@ def safesystemin(*args) logger.info("[[[ DEBUG CHECKPOINT, safesystemin(), 122 ]]]") stdin.close logger.info("[[[ DEBUG CHECKPOINT, safesystemin(), 123 ]]]") - stdout_r_str = stdout.read +# stdout_r_str = stdout.read logger.info("[[[ DEBUG CHECKPOINT, safesystemin(), 124 ]]]") - stderr_r_str = stderr.read +# stderr_r_str = stderr.read logger.info("[[[ DEBUG CHECKPOINT, safesystemin(), 125 ]]]") end logger.info("[[[ DEBUG CHECKPOINT, safesystemin(), 126 ]]]")