summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2006-08-04 09:48:38 +0000
committerChris Johns <chrisj@rtems.org>2006-08-04 09:48:38 +0000
commit808db8ea74dac85bca32eccbc4da3f1e732b0a13 (patch)
tree8ca1a6dfa46616304b103e56f64f8fd626412ccc /contrib
parentUpdated hello screen. (diff)
downloadrtems-808db8ea74dac85bca32eccbc4da3f1e732b0a13.tar.bz2
Fix the return code when used with tee.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/mingw/build.sh19
1 files changed, 15 insertions, 4 deletions
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