diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-06-20 10:23:51 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-06-21 09:34:51 +0200 |
commit | 4103d75447962eb88d5c2af49ecff340efc2dd9d (patch) | |
tree | e61e6c5e3f341ab403e802edea53799510273f4b /scripts | |
parent | 396852e8d5aed76a88e99f1dc8af279fcf9f0eb3 (diff) | |
download | ptxdist-4103d75447962eb88d5c2af49ecff340efc2dd9d.tar.gz ptxdist-4103d75447962eb88d5c2af49ecff340efc2dd9d.tar.xz |
ptxd_make_log: order bailout messages correctly
This basically reverts bf1a5b588e4c1b0ac7dbfd52d4acb4c0d1b81539
("ptxd_make_log: improve output handling") and implements it differently.
Showing the bailout message even when quiet is enabled is good, but using
the error path breaks the ordering in the logfile when output-sync is
enabled.
Use the normal output explicitly write the message to stdout if quiet is
enabled.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/libptxdist.sh | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh index c0641e3de..ffbe839f5 100644 --- a/scripts/libptxdist.sh +++ b/scripts/libptxdist.sh @@ -390,13 +390,6 @@ ptxd_make_log() {( # stderr and logfile exec {logerr}> >(tee -a "${PTX_LOGFILE}" >&2) - export PTXDIST_FD_LOG_STDOUT=${logout} - export PTXDIST_FD_LOG_STDERR=${logerr} - if [ ${PTXDIST_FD_LOGERR} = 1 ]; then - PTXDIST_FD_LOGERR=${PTXDIST_FD_LOG_STDOUT} - else - PTXDIST_FD_LOGERR=${PTXDIST_FD_LOG_STDERR} - fi ptxd_make "${@}" 1>&${logout} 2>&${logerr} )} @@ -743,7 +736,10 @@ ptxd_debug "Debugging is enabled - Turn off with PTX_DEBUG=false" # ${PTXDIST_LOG_PROMPT}: to be printed before message # ptxd_bailout() { - echo "${PTXDIST_LOG_PROMPT}error: $1" >&${PTXDIST_FD_LOG_STDERR} + echo "${PTXDIST_LOG_PROMPT}error: $1" >&2 + if [ -n "${PTXDIST_FD_STDERR}" -a -n "${PTXDIST_QUIET}" ]; then + echo "${PTXDIST_LOG_PROMPT}error: $1" >&${PTXDIST_FD_STDERR} + fi exit ${2:-1} } export -f ptxd_bailout |