testbase 1.58 KB
Newer Older
Karl Chen's avatar
.  
Karl Chen committed
1 2 3 4 5 6 7
#!/bin/sh

## $Id$

# Automate a clean check out, make all, check, distcheck.  On error, complain
# to stdout and return 1.  Suitable for a cron job.

Karl Chen's avatar
.  
Karl Chen committed
8 9
# need to set PATH because we might be running from a cron job.
# on our Solaris servers, cvs is in /opt/misc/bin
Karl Chen's avatar
.  
Karl Chen committed
10 11

if [ -d /disks/asimov ]; then
Karl Chen's avatar
Karl Chen committed
12
    PATH=/disks/philmor/a/users/quarl/local/Node-SOLARIS/bin:/disks/philmor/a/users/quarl/local/bin:/disks/philmor/a/users/quarl/bin:/usr/local/gcc/bin:/usr/local/gdb/bin:/usr/ccs/bin:/usr/local/cygnus:/disks/milkyway/a/users/anderson/seti/bin:/disks/cyclops/c/users/seti/s4/siren/bin:/disks/cyclops/c/users/seti/s4/siren/scripts:/disks/cyclops/c/users/seti/s4/siren/scripts/s4pipeline:/opt/misc/bin:/usr/ucb:/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/dt/bin:/opt/misc/rsi/idl/bin:/opt/misc/lib/teTeX/bin:/disks/asimov/a/lang/gcc/bin:.:/usr/local/sbin:/usr/local/bin:/sbin:/usr/games
Karl Chen's avatar
.  
Karl Chen committed
13 14
    export PATH
fi
Karl Chen's avatar
.  
Karl Chen committed
15

Karl Chen's avatar
Karl Chen committed
16
CHECKOUT="CVSROOT=/usr/local/warez/cvsroot cvs co boinc"
Karl Chen's avatar
.  
Karl Chen committed
17 18 19 20
TMPDIR=/tmp/testbase

die()
{
Karl Chen's avatar
.  
Karl Chen committed
21
    echo "ERROR in testbase on `hostname`:"
Karl Chen's avatar
.  
Karl Chen committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    echo "$1"
    [ "$2" ] && cat "$2"
    exit 1
}

reqeval()
{
    eval "$1" || die "error executing: $1"
}

reqeval_log()
{
    eval "$1" > $2 2>&1 || die "error executing: $1" $2
}

Karl Chen's avatar
Karl Chen committed
37 38
if [ -z "$USER" ]; then
    USER=$LOGNAME
Karl Chen's avatar
Karl Chen committed
39
    export USER
Karl Chen's avatar
Karl Chen committed
40
fi
Karl Chen's avatar
.  
Karl Chen committed
41

Karl Chen's avatar
Karl Chen committed
42
chmod -R u+w $TMPDIR 2>/dev/null
Karl Chen's avatar
.  
Karl Chen committed
43 44 45 46 47 48 49 50
reqeval "rm -rf $TMPDIR"
reqeval "mkdir -p $TMPDIR"
reqeval "cd $TMPDIR"
reqeval_log "$CHECKOUT"      checkout.log
reqeval "cd boinc"
reqeval_log "./configure"    configure.log
reqeval_log "make all"       make_all.log
reqeval_log "make check"     make_check.log
Karl Chen's avatar
Karl Chen committed
51
# reqeval_log "make distcheck" make_distcheck.log