functions: DO_WITH_DEBUG: Label stderr/stdout more clearly

"$1 err:" looked like an error, but often there's output on stderr
that's diagnostic (like kexec -d).  "$1 stderr:" is clearer.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
This commit is contained in:
Jonathon Hall 2024-04-19 13:31:29 -04:00
parent 015af7e6c7
commit d8810b7032
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114

View File

@ -94,7 +94,7 @@ DO_WITH_DEBUG() {
# - We capture PIPESTATUS[0] whether the command succeeds or fails,
# since we don't know whether the pipeline status will be that of the
# command or 'tee' (depends on set -o pipefail).
if ! "$@" 2> >(tee /dev/stderr | SINK_DEBUG "$1 err") | tee >(SINK_DEBUG "$1 out"); then
if ! "$@" 2> >(tee /dev/stderr | SINK_DEBUG "$1 stderr") | tee >(SINK_DEBUG "$1 stdout"); then
exit_status="${PIPESTATUS[0]}"
else
exit_status="${PIPESTATUS[0]}"