]> mj.ucw.cz Git - eval.git/commitdiff
Move more things to mop.cf and also include userlist.
authorMartin Mares <mj@ucw.cz>
Sun, 25 May 2008 20:51:56 +0000 (22:51 +0200)
committerMartin Mares <mj@ucw.cz>
Sun, 25 May 2008 20:51:56 +0000 (22:51 +0200)
The old method of listing users by matching UID's is no longer supported.

mop/Makefile
mop/eval/mo-get-users.sh
mop/mop.cf

index 2129525cafd58690138ceeb3a7516fe4548d151c..414e1afa701236b719129e592a57ff8515b53cf4 100644 (file)
@@ -8,5 +8,6 @@ include mop/eval/Makefile
 include mop/public/Makefile
 include mop/score/Makefile
 
-CONFIGS+=mop
+CONFIGS+=mop userlist
 run/cf/mop: $(o)/mop/mop.cf
+run/cf/userlist: $(o)/mop/userlist.cf
index f85919ed8ec6b6d2c572465b1d93e0f294c40e96..8adb6d3819ad66e5881585f78780451ee1e22eb7 100755 (executable)
@@ -3,21 +3,12 @@
 if [ "$1" = --help ] ; then
        echo "Usage: mo-get-users [--full]"
 fi
-[ -f config ] || { echo "Missing config file, check cwd." ; exit 1 ; }
+[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; }
 set -e
-. config
+. cf/mop
 
-if [ -z "$CT_USER_LIST" ] ; then
-       if [ "$1" = --full ] ; then
-               FORM='$1,$5'
-       else
-               FORM='$1'
-       fi
-       awk -F: </etc/passwd "{ gsub(\",.*\",\"\",\$5); OFS=\"\t\"; if (\$3 >= $CT_UID_MIN && \$3 <= $CT_UID_MAX) print $FORM; }"
+if [ "$1" = --full ] ; then
+       cut -d '        ' -f 1,2 <$CT_USER_LIST
 else
-       if [ "$1" = --full ] ; then
-               cut -d '        ' -f 1,2 <$CT_USER_LIST
-       else
-               cut -d '        ' -f 1 <$CT_USER_LIST
-       fi
+       cut -d '        ' -f 1 <$CT_USER_LIST
 fi
index 2f87aceff79b2e04a22e185ffb85848a07e9e420..d3671fe86dd5b565a69fc24d8bf33965e79b9a5c 100644 (file)
@@ -1,19 +1,23 @@
 # Configuration file for the MO-P environment
 # (c) 2001--2008 Martin Mares <mj@ucw.cz>
 
+# The root of the whole contest directory hierarchy
+MO_ROOT=/mo
+
 # These values are used when creating logins for eval and contestants
 # (group id's are from the same range)
 EVAL_UID_MIN=65000
 CT_UID_MIN=65100
 CT_UID_MAX=65199
 
-# Sometimes we need to get a list of all contestants (not in the evaluator
-# itself, but in various auxiliary scripts). In such cases we call mo-get-users,
-# which either uses an explicit list of contestants CT_USER_LIST (username<tab>fullname),
-# or (if undefined) scans /etc/passwd for users with UID between CT_UID_MIN and CT_UID_MAX.
-CT_USER_LIST=userlist
+# A file with the list of all contestants. Consists of tab-separated fields:
+# <login>      <full name>     [<machine>]
+CT_USER_LIST=cf/userlist
 
 # (optional) Use remote submitting
 REMOTE_SUBMIT=1
 REMOTE_SUBMIT_USER=mo-submit
 REMOTE_SUBMIT_GROUP=mo-submit
+
+# Include configuration of the evaluator
+. cf/eval