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