Put server services related scripts under the server-services folder.
1.1 --- a/scripts/repocheck/commit-checker Wed Nov 29 17:35:31 2006 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,113 +0,0 @@
1.4 -#!/bin/bash
1.5 -
1.6 -ROOT=$PWD
1.7 -REV=$1
1.8 -LOGFILE=${ROOT}/logs/${REV}.log
1.9 -
1.10 -function im-not-the-next() {
1.11 - for i in `ls queue`
1.12 - do
1.13 - if [ $i -lt $REV ]; then
1.14 - true
1.15 - return
1.16 - fi
1.17 - done
1.18 - false
1.19 -}
1.20 -
1.21 -function make-dir () {
1.22 - if [ ! -d $1 ]; then
1.23 - mkdir $1
1.24 - fi
1.25 -}
1.26 -
1.27 -function makecheck () {
1.28 - if [ `which $(echo $CXX|cut -f1 -d' ' )` ]; then
1.29 - make-dir $ODIR &&
1.30 - cd $ODIR &&
1.31 - time ../trunk/configure $* &&
1.32 - time make check &&
1.33 - cd ..
1.34 - else
1.35 - echo
1.36 - echo '***************************************************************'
1.37 - echo " COMPILER $CXX CANNOT BE FOUND"
1.38 - echo '***************************************************************'
1.39 - echo
1.40 - fi
1.41 -}
1.42 -
1.43 -function check-compilers() {
1.44 -cd trunk &&
1.45 -autoreconf -vi &&
1.46 -cd .. &&
1.47 -# ODIR=gcc-3.3 CXX=g++-3.3 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
1.48 -# ODIR=gcc-3.4 CXX=g++-3.4 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
1.49 -# ODIR=gcc-4.0 CXX=g++-4.0 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
1.50 -ODIR=gcc-4.1 CXX=g++-4.1 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
1.51 -# # ODIR=icc-8.0 CXX=icpc-8.0 CXXFLAGS='-Werror' makecheck --enable-demo --enable-benchmark &&
1.52 -# ODIR=icc-9.0 CXX='icpc-9.0' CXXFLAGS='-Werror' makecheck --enable-demo --enable-benchmark &&
1.53 -# ODIR=mingw CXX='g++' makecheck --with-msw --target=i586-mingw32msvc --host=i586-mingw32msvc --build=i386-linux --without-glpk &&
1.54 -echo &&
1.55 -echo '**********************************************************************' &&
1.56 -echo ' REPOSITORY SEEMS OK' &&
1.57 -echo '**********************************************************************' &&
1.58 -echo
1.59 -}
1.60 -
1.61 -if [ $# -eq 0 ]; then
1.62 - echo 'Usage:'
1.63 - echo ' commit-checker --init'
1.64 - echo ' commit-checker revision'
1.65 - exit 1
1.66 -elif [ $1 = '--init' ]; then
1.67 - rm -rf queue
1.68 - mkdir queue
1.69 - make-dir logs
1.70 - rm -rf trunk
1.71 - svn co https://lemon.cs.elte.hu/svn/hugo/trunk
1.72 - exit 0
1.73 -fi
1.74 -
1.75 -touch ${ROOT}/queue/$REV
1.76 -
1.77 -while im-not-the-next; do
1.78 - sleep 10
1.79 -done
1.80 -
1.81 -# echo RUN $REV
1.82 -
1.83 -svn up -r$REV trunk >${LOGFILE} 2>&1
1.84 -
1.85 -AUTHOR=`svn info trunk|grep 'Last Changed Author:'|cut -d ' ' -f 4`
1.86 -EMAIL=`awk '$1=="'${AUTHOR}'" {print $2}' <${ROOT}/e-mails`
1.87 -
1.88 -echo '
1.89 -
1.90 -*************************************************************
1.91 -Check revision '${REV}' of '${AUTHOR}' ('${EMAIL}')
1.92 -*************************************************************
1.93 -
1.94 -'>>${LOGFILE} 2>&1
1.95 -
1.96 -if check-compilers >>${LOGFILE} 2>&1
1.97 -then
1.98 - echo -n
1.99 -# echo OK $AUTHOR $EMAIL $REV
1.100 -else
1.101 -# echo NEMOK $AUTHOR $EMAIL $REV
1.102 - echo 'Dear '${AUTHOR}',
1.103 -Your svn commit -r'${REV}' made the repository broken.
1.104 -The compilation log is attached.
1.105 -Please fix the problem as soon as possible.
1.106 -
1.107 -Best regards,
1.108 -LEMON Commit Checking Service
1.109 -'|
1.110 - mail -a ${LOGFILE} -s '[LEMON-SVN] WARNING: Broken repository' \
1.111 - ${EMAIL} alpar@cs.elte.hu
1.112 -fi
1.113 -
1.114 -# rm ${LOGFILE}
1.115 -rm ${ROOT}/queue/$REV
1.116 -
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/scripts/server-services/repocheck/commit-checker Thu Nov 30 13:43:49 2006 +0000
2.3 @@ -0,0 +1,113 @@
2.4 +#!/bin/bash
2.5 +
2.6 +ROOT=$PWD
2.7 +REV=$1
2.8 +LOGFILE=${ROOT}/logs/${REV}.log
2.9 +
2.10 +function im-not-the-next() {
2.11 + for i in `ls queue`
2.12 + do
2.13 + if [ $i -lt $REV ]; then
2.14 + true
2.15 + return
2.16 + fi
2.17 + done
2.18 + false
2.19 +}
2.20 +
2.21 +function make-dir () {
2.22 + if [ ! -d $1 ]; then
2.23 + mkdir $1
2.24 + fi
2.25 +}
2.26 +
2.27 +function makecheck () {
2.28 + if [ `which $(echo $CXX|cut -f1 -d' ' )` ]; then
2.29 + make-dir $ODIR &&
2.30 + cd $ODIR &&
2.31 + time ../trunk/configure $* &&
2.32 + time make check &&
2.33 + cd ..
2.34 + else
2.35 + echo
2.36 + echo '***************************************************************'
2.37 + echo " COMPILER $CXX CANNOT BE FOUND"
2.38 + echo '***************************************************************'
2.39 + echo
2.40 + fi
2.41 +}
2.42 +
2.43 +function check-compilers() {
2.44 +cd trunk &&
2.45 +autoreconf -vi &&
2.46 +cd .. &&
2.47 +# ODIR=gcc-3.3 CXX=g++-3.3 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
2.48 +# ODIR=gcc-3.4 CXX=g++-3.4 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
2.49 +# ODIR=gcc-4.0 CXX=g++-4.0 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
2.50 +ODIR=gcc-4.1 CXX=g++-4.1 CXXFLAGS='-W -Wall -Werror' makecheck --enable-demo --enable-benchmark &&
2.51 +# # ODIR=icc-8.0 CXX=icpc-8.0 CXXFLAGS='-Werror' makecheck --enable-demo --enable-benchmark &&
2.52 +# ODIR=icc-9.0 CXX='icpc-9.0' CXXFLAGS='-Werror' makecheck --enable-demo --enable-benchmark &&
2.53 +# ODIR=mingw CXX='g++' makecheck --with-msw --target=i586-mingw32msvc --host=i586-mingw32msvc --build=i386-linux --without-glpk &&
2.54 +echo &&
2.55 +echo '**********************************************************************' &&
2.56 +echo ' REPOSITORY SEEMS OK' &&
2.57 +echo '**********************************************************************' &&
2.58 +echo
2.59 +}
2.60 +
2.61 +if [ $# -eq 0 ]; then
2.62 + echo 'Usage:'
2.63 + echo ' commit-checker --init'
2.64 + echo ' commit-checker revision'
2.65 + exit 1
2.66 +elif [ $1 = '--init' ]; then
2.67 + rm -rf queue
2.68 + mkdir queue
2.69 + make-dir logs
2.70 + rm -rf trunk
2.71 + svn co https://lemon.cs.elte.hu/svn/hugo/trunk
2.72 + exit 0
2.73 +fi
2.74 +
2.75 +touch ${ROOT}/queue/$REV
2.76 +
2.77 +while im-not-the-next; do
2.78 + sleep 10
2.79 +done
2.80 +
2.81 +# echo RUN $REV
2.82 +
2.83 +svn up -r$REV trunk >${LOGFILE} 2>&1
2.84 +
2.85 +AUTHOR=`svn info trunk|grep 'Last Changed Author:'|cut -d ' ' -f 4`
2.86 +EMAIL=`awk '$1=="'${AUTHOR}'" {print $2}' <${ROOT}/e-mails`
2.87 +
2.88 +echo '
2.89 +
2.90 +*************************************************************
2.91 +Check revision '${REV}' of '${AUTHOR}' ('${EMAIL}')
2.92 +*************************************************************
2.93 +
2.94 +'>>${LOGFILE} 2>&1
2.95 +
2.96 +if check-compilers >>${LOGFILE} 2>&1
2.97 +then
2.98 + echo -n
2.99 +# echo OK $AUTHOR $EMAIL $REV
2.100 +else
2.101 +# echo NEMOK $AUTHOR $EMAIL $REV
2.102 + echo 'Dear '${AUTHOR}',
2.103 +Your svn commit -r'${REV}' made the repository broken.
2.104 +The compilation log is attached.
2.105 +Please fix the problem as soon as possible.
2.106 +
2.107 +Best regards,
2.108 +LEMON Commit Checking Service
2.109 +'|
2.110 + mail -a ${LOGFILE} -s '[LEMON-SVN] WARNING: Broken repository' \
2.111 + ${EMAIL} alpar@cs.elte.hu
2.112 +fi
2.113 +
2.114 +# rm ${LOGFILE}
2.115 +rm ${ROOT}/queue/$REV
2.116 +