diff -r 1ee6e8788cc7 -r abf880d78522 scripts/repocheck/commit-checker --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/repocheck/commit-checker Wed Nov 08 23:28:14 2006 +0000 @@ -0,0 +1,113 @@ +#!/bin/bash + +ROOT=$PWD +REV=$1 +LOGFILE=${ROOT}/logs/${REV}.log + +function im-not-the-next() { + for i in `ls queue` + do + if [ $i -lt $REV ]; then + true + return + fi + done + false +} + +function make-dir () { + if [ ! -d $1 ]; then + mkdir $1 + fi +} + +function makecheck () { + if [ `which $(echo $CXX|cut -f1 -d' ' )` ]; then + make-dir $ODIR && + cd $ODIR && + time ../trunk/configure $* && + time make check && + cd .. + else + echo + echo '***************************************************************' + echo " COMPILER $CXX CANNOT BE FOUND" + echo '***************************************************************' + echo + fi +} + +function check-compilers() { +cd trunk && +autoreconf -vi && +cd .. && +# ODIR=gcc-3.3 CXX=g++-3.3 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark && +# ODIR=gcc-3.4 CXX=g++-3.4 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark && +# ODIR=gcc-4.0 CXX=g++-4.0 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark && +ODIR=gcc-4.1 CXX=g++-4.1 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark && +# # ODIR=icc-8.0 CXX=icpc-8.0 CXXFLAGS='-Werror' makecheck --enable-demo --enable-benchmark && +# ODIR=icc-9.0 CXX='icpc-9.0' CXXFLAGS='-Werror' makecheck --enable-demo --enable-benchmark && +# ODIR=mingw CXX='g++' makecheck --with-msw --target=i586-mingw32msvc --host=i586-mingw32msvc --build=i386-linux --without-glpk && +echo && +echo '**********************************************************************' && +echo ' REPOSITORY SEEMS OK' && +echo '**********************************************************************' && +echo +} + +if [ $# -eq 0 ]; then + echo 'Usage:' + echo ' commit-checker --init' + echo ' commit-checker revision' + exit 1 +elif [ $1 = '--init' ]; then + rm -rf queue + mkdir queue + make-dir logs + rm -rf trunk + svn co https://lemon.cs.elte.hu/svn/hugo/trunk + exit 0 +fi + +touch queue/$REV + +while im-not-the-next; do + sleep 10 +done + +echo RUN $REV + +svn up -r$REV trunk >${LOGFILE} 2>&1 + +AUTHOR=`svn info trunk|grep 'Last Changed Author:'|cut -d ' ' -f 4` +EMAIL=`awk '$1=="'${AUTHOR}'" {print $2}' <${ROOT}/e-mails` + +echo ' + +************************************************************* +Check revision '${REV}' of '${AUTHOR}' ('${EMAIL}') +************************************************************* + +'>>${LOGFILE} 2>&1 + +if check-compilers >>${LOGFILE} 2>&1 +then + echo -n + echo OK $AUTHOR $EMAIL $REV +else + echo NEMOK $AUTHOR $EMAIL $REV + echo 'Dear '${AUTHOR}', +Your svn commit -r'${REV}' made the repository broken. +The compilation log is attached. +Please fix the problem as soon as possible. + +Best regards, +LEMON Commit Checking Service +'| + mail -a ${LOGFILE} -s '[LEMON-SVN] WARNING: Broken repository' \ + alpar@cs.elte.hu +fi + +# rm ${LOGFILE} +rm queue/$REV +