diff --git a/bin/package b/bin/package index 4b1272594..9904d4109 100755 --- a/bin/package +++ b/bin/package @@ -3966,13 +3966,18 @@ capture() # file command ... 0) if executable ! $TEE then TEE=tee fi + rm -f $o.fifo + mkfifo -m 600 $o.fifo || exit + $TEE -a $o < $o.fifo & { case $s in ?*) echo "$s" ;; esac showenv $action "$@" - } < /dev/null 2>&1 | $TEE -a $o + } > $o.fifo 2>&1 & + rm $o.fifo # unlink early + wait "$!" # get build's exit status ;; *) { case $s in @@ -3987,6 +3992,10 @@ capture() # file command ... *) $make "$@" ;; esac + exit_status=$? + if test "$exit_status" -gt "$error_status" + then error_status=$exit_status + fi } package_install() # dest sum @@ -4358,6 +4367,8 @@ isascii() return $__isascii__ } +error_status=0 + case $action in admin) while test ! -f $admin_db @@ -7358,3 +7369,5 @@ TEST) set '' $target $package ;; esac + +exit "$error_status" diff --git a/src/cmd/INIT/package.sh b/src/cmd/INIT/package.sh index 99f56e322..59c9cdd5b 100644 --- a/src/cmd/INIT/package.sh +++ b/src/cmd/INIT/package.sh @@ -3965,13 +3965,18 @@ capture() # file command ... 0) if executable ! $TEE then TEE=tee fi + rm -f $o.fifo + mkfifo -m 600 $o.fifo || exit + $TEE -a $o < $o.fifo & { case $s in ?*) echo "$s" ;; esac showenv $action "$@" - } < /dev/null 2>&1 | $TEE -a $o + } > $o.fifo 2>&1 & + rm $o.fifo # unlink early + wait "$!" # get build's exit status ;; *) { case $s in @@ -3986,6 +3991,10 @@ capture() # file command ... *) $make "$@" ;; esac + exit_status=$? + if test "$exit_status" -gt "$error_status" + then error_status=$exit_status + fi } package_install() # dest sum @@ -4357,6 +4366,8 @@ isascii() return $__isascii__ } +error_status=0 + case $action in admin) while test ! -f $admin_db @@ -7357,3 +7368,5 @@ TEST) set '' $target $package ;; esac + +exit "$error_status"