From: Mark Wooding Date: Sun, 10 May 2020 14:00:31 +0000 (+0100) Subject: bin/mdw-build: Do all of the log descriptor setting in one place. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/5043931a10844e37043d233817e7047704080abc bin/mdw-build: Do all of the log descriptor setting in one place. Rather than setting things up for a verbose build and then changing things later. --- diff --git a/bin/mdw-build b/bin/mdw-build index fb98ffa..b5bbbf3 100755 --- a/bin/mdw-build +++ b/bin/mdw-build @@ -193,8 +193,6 @@ case $jobs in 1) ;; *) makeopts="$makeopts -j$jobs" ;; esac ## diag -- null (verbose), or logfile (quiet); primary diagnostic output ## term -- orginal stderr; secondary diagnostic output (with colours) -exec {log}>&2 {diag}>/dev/null {term}>&2 - notify () { colour=$1 message=$2 echo $message >&$diag @@ -267,12 +265,15 @@ releasepath=$toppath/dist-$build$qual chmod -R +w $releasepath 2>/dev/null || : rm -rf $releasepath 2>/dev/null || : mkdir $releasepath +exec {term}>&2 case $verbose in no) - exec {log}>&- {diag}>&- exec {diag}>$releasepath/mdw-build.log {log}>&$diag || fail "Failed to create log." ;; + yes) + exec {diag}>/dev/null {log}>&2 + ;; esac ## Repeat the earlier assignments for tbe benefit of the logfile.