]> mj.ucw.cz Git - eval.git/blob - public/status
Renamed log() to msg() in order to avoid compiler warnings.
[eval.git] / public / status
1 #!/bin/bash
2 # The Evaluator -- Public Status Script
3 # (c) 2004 Martin Mares <mj@ucw.cz>
4
5 set -e
6 [ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; }
7 . $MO_ROOT/bin/lib
8 . $MO_ROOT/config
9
10 [ -z "$1" ] || die "Usage: status"
11
12 echo -e "Submitted tasks:\n"
13
14 if [ -n "$REMOTE_SUBMIT" ] ; then
15         exec $MO_ROOT/bin/remote-status
16 fi
17
18 for PROBLEM in `cd $MO_ROOT/problems/ ; echo *` ; do
19         (
20         PDIR=$MO_ROOT/problems/$PROBLEM
21         SUBDIR=~/.submit/$PROBLEM
22         [ -f $PDIR/config ] || exit 0
23         echo -n "$PROBLEM: "
24         . $PDIR/config
25         if [ -d $SUBDIR ] ; then
26                 if [ $TASK_TYPE == open-data ] ; then
27                         for X in $TESTS ; do
28                                 [ -f $SUBDIR/$X.out ] && echo -n "$X " || echo -n "- "
29                         done
30                         echo
31                 else
32                         C=0
33                         for X in $EXTENSIONS ; do
34                                 if [ -f $SUBDIR/$PROBLEM.$X ] ; then
35                                         echo -n `basename $SUBDIR/$PROBLEM.$X`
36                                         C=$(($C+1))
37                                 fi
38                         done
39                         if [ $C == 0 ] ; then
40                                 echo ---
41                         elif [ $C == 1 ] ; then
42                                 echo
43                         else
44                                 echo "INCONSISTENT (you probably modified $SUBDIR manually)"
45                         fi
46                 fi
47         else
48                 echo ---
49         fi
50         )
51 done