From 8757ac6e1737d175bf26b0a90ba913aa61dc28c4 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 4 Dec 2006 11:11:04 +0000 Subject: [PATCH] Clifford Wolf: Fixed 'Build-Pkg -download' output [2006111815064513431] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8076 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- Documentation/Developers/REGISTER | 1 + scripts/Build-Pkg | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Documentation/Developers/REGISTER b/Documentation/Developers/REGISTER index cb8ed8d11..bb11b5cba 100644 --- a/Documentation/Developers/REGISTER +++ b/Documentation/Developers/REGISTER @@ -115,6 +115,7 @@ Filedescriptor Numbers 199 Output plugins unchroot mechanism 200 Package build $builddir/build.pid 201 Target build $build_logs/build_target_$$.log +202 FD for writing outputs to console, not build log Licence Names (for package description): diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index bd2e7bb5d..5855b7f98 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -764,6 +764,9 @@ abort() { false } +# FD 202 can be used to write output to console instead of build log +exec 202>&1 + { ( set -e @@ -773,6 +776,9 @@ abort() { set -o xtrace fi + trap 'echo "Got SIGINT (Crtl-C). Aborting build." ; exit 1' INT + exec < /dev/null + hook_eval prepare mkdir -p "$builddir/archdir" @@ -788,7 +794,7 @@ abort() { echo; ./scripts/Download $xpkg; echo echo_status "------------------------" download=0 - fi + fi >&202 2>&1 if [ ! -f $x ]; then echo "File not found: ${x#$base/}" abort "Did you run ./scripts/Download for this package?" @@ -797,8 +803,8 @@ abort() { ln -vs $x "$builddir/archdir/" done < <( echo "$desc_D" | column_clean ) - trap 'echo "Got SIGINT (Crtl-C). Aborting build." ; exit 1' INT - exec < /dev/null + echo_status "Building. Writing output to" \ + "\$root/var/adm/logs/$stagelevel-$xpkg.out" >&202 # Makes debugging build problems easier # @@ -1198,9 +1204,6 @@ EOT } 2>&1 | { trap '' INT - echo_status "Building. Writing output to" \ - "\$root/var/adm/logs/$stagelevel-$xpkg.out" - if [ "$ROCKCFG_VERBOSE" = 1 -o "$verbose" = 1 ] ; then tee $root/var/adm/logs/$stagelevel-$xpkg.out else