From 808db8ea74dac85bca32eccbc4da3f1e732b0a13 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 4 Aug 2006 09:48:38 +0000 Subject: Fix the return code when used with tee. --- contrib/mingw/build.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/mingw/build.sh b/contrib/mingw/build.sh index 61b3dc3003..927b84d4a3 100755 --- a/contrib/mingw/build.sh +++ b/contrib/mingw/build.sh @@ -1,3 +1,4 @@ +#! /bin/sh # # $Id$ # @@ -8,16 +9,19 @@ # Note: This file should be placed in crossrpms. # +command_line="$0 $*" + terminate() { echo "error: $*" >&2 exit 1 + echo "after" } check() { if [ $? -ne 0 ]; then - terminate + terminate $* fi } @@ -80,11 +84,18 @@ do shift done +echo "$command_line" > $log + scripts=$(dirname $0) -$scripts/build-rpms.sh -i $debug $no_run $prefix $source $targets $hosts $version 2>&1 | tee $log -check "Making the RPM files." +$scripts/build-rpms.sh -i $debug $no_run $prefix $source $targets $hosts $version 2>&1 | tee -a $log +if [ ${PIPESTATUS[0]} -ne 0 ]; then + terminate "Making the RPM files." +fi $scripts/build-exes.sh $debug $no_run $prefix $targets $relocation 2>&1 | tee -a $log -check "Making the executable files." +if [ ${PIPESTATUS[0]} -ne 0 ]; then + terminate "Making the executable files." +fi +exit 0 -- cgit v1.2.3