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