Use tee for logging

pull/1/head
Tatsuhiro Tsujikawa 2009-02-15 14:52:19 +00:00
parent 2259dea9a7
commit 38e9f1febc
1 changed files with 12 additions and 13 deletions

View File

@ -1,13 +1,12 @@
#!/bin/sh #!/bin/sh
exec 2>&1 #exec 2>&1
BUILD_TEST_DIR=/tmp/aria2_build_test BUILDDIR=/tmp/aria2buildtest
if [ ! -d "$BUILD_TEST_DIR" ]; then if [ ! -d "$BUILDDIR" ]; then
mkdir "$BUILD_TEST_DIR" \ mkdir "$BUILDDIR" \
|| echo "Failed to create directory $BUILD_TEST_DIR" \ || { echo "Failed to create directory $BUILDDIR" && exit -1; }
&& exit -1
fi fi
echo -n "Starting build test " echo -n "Starting build test "
@ -20,20 +19,20 @@ build()
echo `date` echo `date`
echo "*** configure opts=$1" echo "*** configure opts=$1"
BIN_NAME="aria2c_$2" BIN_NAME="aria2c_$2"
if [ -f "$BUILD_TEST_DIR/$BIN_NAME" ]; then if [ -f "$BUILDDIR/$BIN_NAME" ]; then
echo "$BIN_NAME exists, skipping" echo "$BIN_NAME exists, skipping"
return return
fi fi
./configure $1 \ ./configure $1 2>&1 | tee "$BUILDDIR/configure_$2.log"\
&& cp config.log "$BUILD_TEST_DIR/config.log_$2" \ && cp config.log "$BUILDDIR/config.log_$2" \
&& LANG=C make -j2 check > "$BUILD_TEST_DIR/aria2c_$2.log" \ && LANG=C make -j2 check 2>&1 |tee "$BUILDDIR/aria2c_$2.log" \
&& cp src/aria2c "$BUILD_TEST_DIR/aria2c_$2" && cp src/aria2c "$BUILDDIR/aria2c_$2"
} }
clear() clear()
{ {
for file in `ls $BUILD_TEST_DIR`; do for file in `ls $BUILDDIR`; do
rm -f "$BUILD_TEST_DIR/$file"; rm -f "$BUILDDIR/$file";
done done
} }