From 1720c3b23dc805b9af4862a09b0d2f17859b9999 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 25 May 2008 22:51:56 +0200 Subject: [PATCH] Move more things to mop.cf and also include userlist. The old method of listing users by matching UID's is no longer supported. --- mop/Makefile | 3 ++- mop/eval/mo-get-users.sh | 19 +++++-------------- mop/mop.cf | 14 +++++++++----- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/mop/Makefile b/mop/Makefile index 2129525..414e1af 100644 --- a/mop/Makefile +++ b/mop/Makefile @@ -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 diff --git a/mop/eval/mo-get-users.sh b/mop/eval/mo-get-users.sh index f85919e..8adb6d3 100755 --- a/mop/eval/mo-get-users.sh +++ b/mop/eval/mo-get-users.sh @@ -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: = $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 diff --git a/mop/mop.cf b/mop/mop.cf index 2f87ace..d3671fe 100644 --- a/mop/mop.cf +++ b/mop/mop.cf @@ -1,19 +1,23 @@ # Configuration file for the MO-P environment # (c) 2001--2008 Martin Mares +# 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 (usernamefullname), -# 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: +# [] +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 -- 2.39.2