]> mj.ucw.cz Git - moe.git/blob - bin/mo-ev-inc
Added incremental evaluator.
[moe.git] / bin / mo-ev-inc
1 #!/bin/bash
2
3 [ -n "$1" ] || { echo "Usage: mo-ev-inc <tasks>" ; exit 1 ; }
4
5 for user in `bin/mo-get-users` ; do
6         for task in "$@" ; do
7                 echo -n "$user/$task: "
8                 if [ -d solutions/$user/$task ] ; then
9                         N=`cd solutions/$user/$task && cat * | md5sum | head -c16` 
10                 else
11                         N=none
12                 fi
13                 if [ -f testing/$user/$task/sum ] ; then
14                         O=`cat testing/$user/$task/sum`
15                 else
16                         O=none
17                 fi
18                 echo -n "($O $N) "
19                 if [ $O == $N ] ; then
20                         echo OK
21                 elif [ $N == none ] ; then
22                         rm -rf testing/$user/$task
23                         echo DELETED
24                 else
25                         echo CHANGED
26                         bin/ev $user $task
27                         echo $N >testing/$user/$task/sum
28                 fi
29         done
30 done