From 83482eb9a6225c636e09fb89f4ee7f93684b04b2 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 29 Jun 2015 16:30:14 +0200 Subject: [PATCH] MO-P: Deleted non-CMS utilities --- mop/Makefile | 6 +- mop/admin/Makefile | 24 +-- mop/admin/mo-back-grab.sh | 24 --- mop/admin/mo-back-status.sh | 23 --- mop/admin/mo-backup.sh | 0 mop/admin/mo-create-contestants.sh | 0 mop/admin/mo-create-eval.sh | 19 -- mop/admin/mo-create-logins.sh | 0 mop/admin/mo-create-public.sh | 0 mop/admin/mo-create-submit.sh | 33 --- mop/admin/mo-create-testusers.sh | 21 -- mop/{eval => admin}/mo-get-users.sh | 0 mop/admin/mo-grab-remote.sh | 22 -- mop/admin/mo-grab.sh | 28 --- mop/admin/mo-install.sh | 38 ---- mop/admin/mo-push-certs.sh | 15 -- mop/admin/mo-push-feedback.sh | 15 -- mop/calibrate/Makefile | 8 - mop/calibrate/cal-prepare.sh | 13 -- mop/calibrate/cal-try.sh | 84 -------- mop/eval/Makefile | 13 -- mop/eval/mo-ev-all.sh | 12 -- mop/eval/mo-ev-inc.sh | 40 ---- mop/eval/mo-report.sh | 61 ------ mop/eval/mo-score.sh | 297 --------------------------- mop/patches/fpc/fpc222aborting.desc | 20 -- mop/patches/fpc/fpc222aborting.patch | 138 ------------- mop/public/Makefile | 10 - mop/public/check.sh | 73 ------- mop/public/compile.sh | 37 ---- mop/public/status.sh | 53 ----- mop/public/submit.sh | 107 ---------- mop/score/Makefile | 7 - mop/score/mo-score-mop.sh | 54 ----- 34 files changed, 8 insertions(+), 1287 deletions(-) delete mode 100755 mop/admin/mo-back-grab.sh delete mode 100755 mop/admin/mo-back-status.sh mode change 100755 => 100644 mop/admin/mo-backup.sh mode change 100755 => 100644 mop/admin/mo-create-contestants.sh delete mode 100755 mop/admin/mo-create-eval.sh mode change 100755 => 100644 mop/admin/mo-create-logins.sh mode change 100755 => 100644 mop/admin/mo-create-public.sh delete mode 100755 mop/admin/mo-create-submit.sh delete mode 100755 mop/admin/mo-create-testusers.sh rename mop/{eval => admin}/mo-get-users.sh (100%) mode change 100755 => 100644 delete mode 100755 mop/admin/mo-grab-remote.sh delete mode 100755 mop/admin/mo-grab.sh delete mode 100755 mop/admin/mo-install.sh delete mode 100755 mop/admin/mo-push-certs.sh delete mode 100755 mop/admin/mo-push-feedback.sh delete mode 100644 mop/calibrate/Makefile delete mode 100755 mop/calibrate/cal-prepare.sh delete mode 100755 mop/calibrate/cal-try.sh delete mode 100644 mop/eval/Makefile delete mode 100755 mop/eval/mo-ev-all.sh delete mode 100755 mop/eval/mo-ev-inc.sh delete mode 100755 mop/eval/mo-report.sh delete mode 100755 mop/eval/mo-score.sh delete mode 100644 mop/patches/fpc/fpc222aborting.desc delete mode 100644 mop/patches/fpc/fpc222aborting.patch delete mode 100644 mop/public/Makefile delete mode 100755 mop/public/check.sh delete mode 100755 mop/public/compile.sh delete mode 100755 mop/public/status.sh delete mode 100755 mop/public/submit.sh delete mode 100644 mop/score/Makefile delete mode 100755 mop/score/mo-score-mop.sh diff --git a/mop/Makefile b/mop/Makefile index 2418101..6abf7ff 100644 --- a/mop/Makefile +++ b/mop/Makefile @@ -1,13 +1,9 @@ # Makefile for MO-P contest environment -# (c) 2008 Martin Mares +# (c) 2008--2015 Martin Mares DIRS+=mop include $(s)/mop/admin/Makefile -include $(s)/mop/eval/Makefile -include $(s)/mop/public/Makefile -include $(s)/mop/score/Makefile -include $(s)/mop/calibrate/Makefile CONFIGS+=mop userlist run/cf/mop: $(o)/mop/mop.cf diff --git a/mop/admin/Makefile b/mop/admin/Makefile index b4d1519..359ea2c 100644 --- a/mop/admin/Makefile +++ b/mop/admin/Makefile @@ -1,29 +1,19 @@ # Makefile for MO-P contest environment -# (c) 2008 Martin Mares +# (c) 2008--2015 Martin Mares DIRS+=mop/admin PROGS+=$(addprefix $(o)/mop/admin/,\ md5crypt \ - mo-backup mo-back-status \ - mo-install mo-create-contestants mo-create-eval mo-create-logins \ - mo-create-public mo-create-submit mo-create-testusers \ - mo-grab mo-back-grab mo-grab-remote \ - mo-push-certs mo-push-feedback mo-cms-users) + mo-backup \ + mo-cms-users \ + mo-create-contestants mo-create-logins mo-create-public \ + mo-get-users) $(o)/mop/admin/md5crypt: $(o)/mop/admin/md5crypt.o $(LIBUCW) -$(o)/mop/admin/mo-back-grab: $(s)/mop/admin/mo-back-grab.sh -$(o)/mop/admin/mo-back-status: $(s)/mop/admin/mo-back-status.sh $(o)/mop/admin/mo-backup: $(s)/mop/admin/mo-backup.sh +$(o)/mop/admin/mo-cms-users: $(s)/mop/admin/mo-cms-users.pl +$(o)/mop/admin/mo-get-users: $(s)/mop/admin/mo-get-users.sh $(o)/mop/admin/mo-create-contestants: $(s)/mop/admin/mo-create-contestants.sh -$(o)/mop/admin/mo-create-eval: $(s)/mop/admin/mo-create-eval.sh $(o)/mop/admin/mo-create-logins: $(s)/mop/admin/mo-create-logins.sh $(o)/mop/admin/mo-create-public: $(s)/mop/admin/mo-create-public.sh -$(o)/mop/admin/mo-create-submit: $(s)/mop/admin/mo-create-submit.sh -$(o)/mop/admin/mo-create-testusers: $(s)/mop/admin/mo-create-testusers.sh -$(o)/mop/admin/mo-grab-remote: $(s)/mop/admin/mo-grab-remote.sh -$(o)/mop/admin/mo-grab: $(s)/mop/admin/mo-grab.sh -$(o)/mop/admin/mo-install: $(s)/mop/admin/mo-install.sh -$(o)/mop/admin/mo-push-certs: $(s)/mop/admin/mo-push-certs.sh -$(o)/mop/admin/mo-push-feedback: $(s)/mop/admin/mo-push-feedback.sh -$(o)/mop/admin/mo-cms-users: $(s)/mop/admin/mo-cms-users.pl diff --git a/mop/admin/mo-back-grab.sh b/mop/admin/mo-back-grab.sh deleted file mode 100755 index bfdf71c..0000000 --- a/mop/admin/mo-back-grab.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Find all submits in the local copy of contestants' home directories -# (as created by mo-backup) and copy them to solutions/. - -if [ -z "$1" ] ; then - echo "Directory name expected" - exit 1 -fi -rm -rf solutions/mo* -for m in `cd $1 ; echo *` ; do - echo -n "$m:" - for d in $1/$m/mo??/mo?? ; do - u=`basename $d` - if [ $u != mo00 -a -d $d/.submit ] ; then - echo -n " $u" - if [ -d solutions/$u ] ; then - echo -n "" - else - cp -a $d/.submit solutions/$u - fi - fi - done - echo -done diff --git a/mop/admin/mo-back-status.sh b/mop/admin/mo-back-status.sh deleted file mode 100755 index 5c4088f..0000000 --- a/mop/admin/mo-back-status.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Find all submits in the local copy of contestants' home directories -# (as created by mo-backup) and print their status. - -if [ -z "$1" ] ; then - echo "Directory name expected" - exit 1 -fi -for m in `cd $1 ; echo *` ; do - echo -n "$m:" - for d in $1/$m/mo??/mo?? ; do - u=`basename $d` - if [ $u != mo00 -a `ls $d | wc -l` -gt 0 ] ; then - echo -n " $u" - if [ -d $d/.submit ] ; then - echo -n '(' - ( cd $d/.submit ; echo -n * ) - echo -n ')' - fi - fi - done - echo -done diff --git a/mop/admin/mo-backup.sh b/mop/admin/mo-backup.sh old mode 100755 new mode 100644 diff --git a/mop/admin/mo-create-contestants.sh b/mop/admin/mo-create-contestants.sh old mode 100755 new mode 100644 diff --git a/mop/admin/mo-create-eval.sh b/mop/admin/mo-create-eval.sh deleted file mode 100755 index c32c976..0000000 --- a/mop/admin/mo-create-eval.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Create home directory of the user who runs the evaluator. - -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop - -H=`pwd` -cd $MO_ROOT/eval - -echo "Creating $EVAL_USER" -rm -rf eval -mkdir eval -cd eval -cp -aL $H/* . -if [ -d ~/.ssh ] ; then echo "Copying SSH configuration from ~/.ssh" ; cp -a ~/.ssh . ; fi -cd .. -chown -R $EVAL_USER.$EVAL_GROUP eval -chmod 750 eval diff --git a/mop/admin/mo-create-logins.sh b/mop/admin/mo-create-logins.sh old mode 100755 new mode 100644 diff --git a/mop/admin/mo-create-public.sh b/mop/admin/mo-create-public.sh old mode 100755 new mode 100644 diff --git a/mop/admin/mo-create-submit.sh b/mop/admin/mo-create-submit.sh deleted file mode 100755 index 2ea6e09..0000000 --- a/mop/admin/mo-create-submit.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Create home directory of the submit server. - -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop -[ -n "$REMOTE_SUBMIT" ] || { echo "Remote submit not enabled." ; exit 1 ; } - -echo "Creating submit directory" - -H=`pwd` -cd $MO_ROOT/eval/submit -mkdir -p certs -cp $H/certs/server* certs/ -cp $H/certs/ca-cert.pem certs/ - -rm -rf bin cf lib -mkdir bin cf -cp $H/bin/{submitd,show-submits} bin/ -cp $H/cf/{submitd,libucw} cf/ -cp -aL $H/lib . - -mkdir -p solutions -for a in `cd $H && bin/mo-get-users` ; do - mkdir -p solutions/$a -done - -rm -rf tmp -mkdir -p tmp - -mkdir -p log history - -chown -R $REMOTE_SUBMIT_USER.$REMOTE_SUBMIT_GROUP $MO_ROOT/eval/submit diff --git a/mop/admin/mo-create-testusers.sh b/mop/admin/mo-create-testusers.sh deleted file mode 100755 index 42e7bfa..0000000 --- a/mop/admin/mo-create-testusers.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# Create accounts used by the sandbox. - -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop - -H=`pwd` -cd $MO_ROOT/eval - -# mo-test home -for u in $TEST_USERS ; do - echo "Creating $u" - rm -rf ./$u - mkdir $u - chown $u.$TEST_GROUP $u - chmod 770 $u - cp $H/bin/box eval/bin/box-$u - chown $u.$EVAL_GROUP eval/bin/box-$u - chmod 4550 eval/bin/box-$u -done diff --git a/mop/eval/mo-get-users.sh b/mop/admin/mo-get-users.sh old mode 100755 new mode 100644 similarity index 100% rename from mop/eval/mo-get-users.sh rename to mop/admin/mo-get-users.sh diff --git a/mop/admin/mo-grab-remote.sh b/mop/admin/mo-grab-remote.sh deleted file mode 100755 index 8754bb3..0000000 --- a/mop/admin/mo-grab-remote.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Grab all submits from the submit server and copy them to solutions/. - -[ -n "$1" ] || { echo "Usage: mo-grab-remote " ; exit 1 ; } -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop - -rsync -a --delete mo-submit@mo100:solutions/ submits -for user in `bin/mo-get-users` ; do - echo -n "$user:" - mkdir -p solutions/$user - for t in $@ ; do - rm -rf solutions/$user/$t - D=submits/$user/$t - if [ -d $D ] ; then - echo -n " $t" - cp -a $D solutions/$user/$t - fi - done - echo -done diff --git a/mop/admin/mo-grab.sh b/mop/admin/mo-grab.sh deleted file mode 100755 index 8bbc8fb..0000000 --- a/mop/admin/mo-grab.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Grab all submits from contestants' home directories located on the -# local machine and copy them to solutions/. - -[ -n "$1" ] || { echo "Usage: mo-grab " ; exit 1 ; } -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop - -for user in `bin/mo-get-users` ; do - echo -n "$user:" - H=`eval echo ~$user`/.submit - if [ -d $H ] ; then - [ -d solutions/$user ] || mkdir -p solutions/$user - for t in $@ ; do - rm -rf solutions/$user/$t - if [ -d $H/$t ] ; then - echo -n " $t" - cp -dr $H/$t solutions/$user/$t - fi - done - echo - else - echo " ---" - fi -done -chown -R $EVAL_USER solutions -chmod -R a+r solutions diff --git a/mop/admin/mo-install.sh b/mop/admin/mo-install.sh deleted file mode 100755 index e458160..0000000 --- a/mop/admin/mo-install.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop - -H=`pwd` - -# The eval directory -cd $MO_ROOT -rm -rf eval -mkdir eval -chgrp $EVAL_GROUP eval -chmod 755 eval -cd eval - -# mo-eval home -( cd $H && bin/mo-create-eval ) - -# testusers -( cd eval && bin/mo-create-testusers ) - -# mo-submit home -if [ -n "$REMOTE_SUBMIT" ] ; then - mkdir submit - chmod 750 submit - if [ -d ~/.ssh ] ; then echo "Copying SSH configuration from ~/.ssh" ; cp -a ~/.ssh submit/ ; fi - ( cd $H && bin/mo-create-submit ) -fi - -# create public -cd $MO_ROOT -echo "Creating public" -rm -rf public -mkdir public - -# populate public -( cd eval/eval ; bin/mo-create-public ) diff --git a/mop/admin/mo-push-certs.sh b/mop/admin/mo-push-certs.sh deleted file mode 100755 index 55a3fd3..0000000 --- a/mop/admin/mo-push-certs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# Copy submit certificates to contestants' machines. Each machine gets -# only the certs of the contestants who should use it. - -[ -f cf/mop ] || { echo "Missing config file, check cwd." ; exit 1 ; } -set -e -. cf/mop - -while IFS=" " read LOGIN FULL MACH ; do - if [ -z "$1" -o "$1" == "$LOGIN" ] ; then - echo "$LOGIN -> $MACH" - D=$MO_ROOT/users/$LOGIN/$LOGIN/ - rsync -av $D/.mo root@$MACH:$D/ - fi $MACH" - D=$MO_ROOT/users/$LOGIN/$LOGIN/ - rsync -av ~mo-eval/testing/$LOGIN root@$MACH:$D/results - ssh root@$MACH "cd $D && chown -R $LOGIN.$LOGIN results" - fi - -DIRS+=mop/calibrate -PROGS+=$(addprefix $(o)/mop/calibrate/,cal-prepare cal-try) - -$(o)/mop/calibrate/cal-prepare: $(s)/mop/calibrate/cal-prepare.sh -$(o)/mop/calibrate/cal-try: $(s)/mop/calibrate/cal-try.sh diff --git a/mop/calibrate/cal-prepare.sh b/mop/calibrate/cal-prepare.sh deleted file mode 100755 index eeeb3fb..0000000 --- a/mop/calibrate/cal-prepare.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Time limit calibrator: Gathering of timing data -# (c) 2010 Martin Mares - -set -e -[ -n "$1" ] -t="$1" -mkdir -p cal/$t -for a in `cd solutions/authors/$t && echo * | sed 's/\.[^ ]*//g'` ; do - bin/ev authors $t $a - cp testing/authors/$t/points cal/$t/$a.points - grep syscalls testing/authors/$t/*.log >cal/$t/$a.log -done diff --git a/mop/calibrate/cal-try.sh b/mop/calibrate/cal-try.sh deleted file mode 100755 index c1874f1..0000000 --- a/mop/calibrate/cal-try.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/perl -# Time limit calibrator: Simulation -# (c) 2010 Martin Mares - -use strict; -use warnings; -use List::Util qw(max); - -my $t = $ARGV[0] or die; -my $thresh = $ARGV[1] || 999; -my $debug = 0; - -my %want = (); -my %points = (); -my %times = (); - -for my $a () { - my $sol = $a; - $sol =~ s/^.*\///; - $sol =~ s/\.points$//; - my ($want) = ($sol =~ m{(\d+)}) or die "Cannot parse $sol\n"; - print "$sol (want $want):" if $debug; - $want{$sol} = $want; - - open PTS, $a or die; - while () { - chomp; - my ($test, $pts, $comment) = split /\s+/; - $points{$sol}{$test} = $pts; - } - close PTS; - - open LOG, "cal/$t/$sol.log" or die; - while () { - chomp; - my ($test, $time) = m{/(\d+[a-z]*)\.log:.*\(([0-9.]+) } or die "Log parse error: $_"; - $times{$sol}{$test} = $time; - } - close LOG; - - for my $t (sort keys %{$points{$sol}}) { - defined $times{$sol}{$t} or $times{$sol}{$t}=0; - print " $t:", $points{$sol}{$t}, "/", $times{$sol}{$t} if $debug; - } - - print "\n" if $debug; -} - -print "\n## Threshold=$thresh\n\n"; - -for my $s (sort keys %want) { - my %groups = (); - my %oks = (); - my %pts = (); - my $maxtime = 0; - my @acc; - my $lastg = ''; - for my $t (sort keys %{$points{$s}}) { - my $g = $t; - $g =~ s{\D+}{}; - if ($g ne $lastg && $lastg ne '') { - push @acc, "|"; - } - $lastg = $g; - $groups{$g}++; - $oks{$g} += 0; - if ($times{$s}{$t} <= $thresh) { - push @acc, ($points{$s}{$t} ? "+" : 0); - $pts{$g} = $points{$s}{$t}; - $oks{$g}++ if $points{$s}{$t}; - $maxtime = max($maxtime, $times{$s}{$t}); - } else { - push @acc, "T"; - } - } - - my $sum = 0; - for my $g (keys %groups) { - if ($groups{$g} == $oks{$g}) { - $sum += $pts{$g}; - } - } - printf "%-40s %2d/%2d %2.3f %s\n", $s, $sum, $want{$s}, $maxtime, join("", @acc); -} diff --git a/mop/eval/Makefile b/mop/eval/Makefile deleted file mode 100644 index 6443cdc..0000000 --- a/mop/eval/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Makefile for MO-P contest environment -# (c) 2008 Martin Mares - -DIRS+=mop/eval -PROGS+=$(addprefix $(o)/mop/eval/,\ - mo-ev-all mo-ev-inc mo-get-users \ - mo-score mo-report) - -$(o)/mop/eval/mo-ev-all: $(s)/mop/eval/mo-ev-all.sh -$(o)/mop/eval/mo-ev-inc: $(s)/mop/eval/mo-ev-inc.sh -$(o)/mop/eval/mo-get-users: $(s)/mop/eval/mo-get-users.sh -$(o)/mop/eval/mo-report: $(s)/mop/eval/mo-report.sh -$(o)/mop/eval/mo-score: $(s)/mop/eval/mo-score.sh diff --git a/mop/eval/mo-ev-all.sh b/mop/eval/mo-ev-all.sh deleted file mode 100755 index f1abc6f..0000000 --- a/mop/eval/mo-ev-all.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Run `ev' on all solutions of given tasks - -[ -n "$1" ] || { echo "Usage: mo-ev-all " ; exit 1 ; } - -while [ -n "$1" ] ; do - for user in `bin/mo-get-users` ; do - echo -e "\n### USER $user TASK $1 ###\n" - bin/ev $user $1 - done - shift -done diff --git a/mop/eval/mo-ev-inc.sh b/mop/eval/mo-ev-inc.sh deleted file mode 100755 index 437d9af..0000000 --- a/mop/eval/mo-ev-inc.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# An incremental evaluator: detect which solutions were changed since -# last run and run `ev' on them. - -[ -n "$1" ] || { echo "Usage: mo-ev-inc [--force] " ; exit 1 ; } - -force=0 -if [ "$1" == --force ] ; then - force=1 - shift -fi -for user in `bin/mo-get-users` ; do - for task in "$@" ; do - echo -n "$user/$task: " - if [ -d solutions/$user/$task ] ; then - N=`cd solutions/$user/$task && cat * | md5sum | head -c16` - else - N=none - fi - if [ -f testing/$user/$task/sum ] ; then - O=`cat testing/$user/$task/sum` - else - O=none - fi - if [ $force == 1 -a $N != none ] ; then - O=forced - fi - echo -n "($O $N) " - if [ $O == $N ] ; then - echo OK - elif [ $N == none ] ; then - rm -rf testing/$user/$task - echo DELETED - else - echo CHANGED - bin/ev $user $task - echo $N >testing/$user/$task/sum - fi - done -done diff --git a/mop/eval/mo-report.sh b/mop/eval/mo-report.sh deleted file mode 100755 index 8dc71ca..0000000 --- a/mop/eval/mo-report.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl -# A simple generator of evaluation reports -# (c) 2007 Martin Mares - -use strict; -use warnings; -use POSIX; - -foreach my $user (`cd testing && ls`) { - chomp $user; - print "$user:"; - open REP, ">testing/$user/REPORT" or die; - print REP "Evaluation report for CEOI 2007 Day 2\n\n"; - my $total = 0; - foreach my $task (@ARGV) { - print REP "### Task $task ###\n\n"; - if (open PTS, "testing/$user/$task/points") { - my %merged_pts = (); - my %split_comm = (); - while () { - chomp; - my ($test, $pts, $comm) = /(\S+)\s+(\S+)\s+(.*)/; - my $merged = $test; - $merged =~ s/[^0-9]//; - if (!defined($merged_pts{$merged}) || $merged_pts{$merged} > $pts) { - $merged_pts{$merged} = $pts; - } - $split_comm{$merged}{$test} = $comm; - } - close PTS; - my $tt = 0; - foreach my $merged (sort { $a <=> $b } keys %merged_pts) { - printf REP "Test %2s: %2d points", $merged, $merged_pts{$merged}; - $tt += $merged_pts{$merged}; - my @k = sort keys %{$split_comm{$merged}}; - if (@k == 1) { - print REP " -- ", $split_comm{$merged}{$k[0]}, "\n"; - } else { - print REP " -- "; - my $cc = 0; - foreach my $t (@k) { - $cc++ and print REP ", "; - print REP "$t: $split_comm{$merged}{$t}"; - } - print REP "\n"; - } - } - print REP "\nTOTAL: $tt points\n\n"; - $total += $tt; - print " $tt"; - } else { - print REP "No solution submitted.\n\n"; - print " -"; - } - } - print REP "### TOTAL FOR DAY 2 ###\n\n"; - print REP "$total points\n"; - print REP "\n\n(generated on ", strftime("%Y-%m-%d %H:%M:%S", localtime), ")\n"; - close REP; - print " -> $total\n"; -} diff --git a/mop/eval/mo-score.sh b/mop/eval/mo-score.sh deleted file mode 100755 index 9326b9a..0000000 --- a/mop/eval/mo-score.sh +++ /dev/null @@ -1,297 +0,0 @@ -#!/usr/bin/perl -# A generator of score sheets. More ugly than it deserves. - -$debug = 0; -$detail = 0; -$html = 0; -$tex = 0; -$extras = 0; -$alt = 0; -$merged = 0; -$table = 0; -$usage = "Usage: mo-score [--detail] [--alt] [--extras] [--html] [--tex] [--table] [--merged] [/] ..."; -while (($arg = $ARGV[0]) =~ /^--([a-z]+)$/) { - shift @ARGV; - $var = "\$$1"; - if (!eval "defined $var") { die $usage; } - eval "$var = 1;"; -} -@ARGV || die $usage; - -$print_key = 1; -if ($table) { - open STDOUT, "|column -t -s'\t'" or die; - $print_key = 0; -} - -print STDERR "Scanning contestants... "; -open (CT, "bin/mo-get-users --full |") || die "Cannot get list of contestants"; -while () { - chomp; - ($u,$f) = split /\t/; - ($u eq "somebody") && next; - $users{$u}=$f; -} -close CT; -print STDERR 0+keys %users, "\n"; - -print STDERR "Scanning exceptions... "; -if ($extras && open (EX, "exceptions")) { - while () { - chomp; - (/^$/ || /^#/) && next; - @a = split /\s+/; - $u = shift @a; - defined $users{$u} || die "Unknown user $u"; - while (@a) { $extra{$u} += shift @a; } - } - close EX; - print STDERR "OK\n"; -} else { print STDERR "none\n"; } - -print STDERR "Scanning task results... "; -%messages = (); -%error_codes = (); -foreach $u (keys %users) { - foreach $task (@ARGV) { - my ($dir, $t) = ("testing", $task); - if ($task =~ m@^(.*)/([^/]*)$@) { - $dir = $1; - $t = $2; - } - $known_tasks{$t} = 1; - $tt = "$dir/$u/$t/points" . ($alt ? ".alt" : ""); - -f $tt || next; - print STDERR "$u/$t "; - open (X, $tt) || die "Unable to open $tt"; - while () { - chomp; - /^(\S+) (-?\d+)\s*(.*)/ || die "Parse error: $_"; - $ttest = $1; - $tpts = $2; - $trem = $3; - $trem =~ s/\[.*//; - ($ttest_merged = $ttest) =~ s/[^0-9]//g; - $ttest = $ttest_merged if $merged; - $known_tests{$t}{$ttest} = 1; - $cmt = $tpts; - if ($tpts == 0 && $trem ne "OK") { - if ($trem =~ /^Compile /) { $cmt = "CE"; } - elsif ($trem =~ /^Time limit exceeded/) { $cmt = "TO"; } - elsif ($trem =~ /^Exited with error /) { $cmt = "RE"; } - elsif ($trem =~ /^Caught fatal signal /) { $cmt = "SG"; } - elsif ($trem =~ /^([A-Za-z])\S*\s+([A-Za-z])/) { - ($cmt = "$1$2") =~ tr/a-z/A-Z/; - } elsif ($trem =~ /^([A-Za-z]{2})/) { - ($cmt = $1) =~ tr/a-z/A-Z/; - } - if (!defined $messages{$trem}) { - $messages{$trem} = $cmt; - if (!defined $error_codes{$cmt}) { - $error_codes{$cmt} = $trem; - } else { - $error_codes{$cmt} .= ", $trem"; - } - } - } - if (!defined($results{$u}{$t}{$ttest}) || $results{$u}{$t}{$ttest} > $tpts) { - $results{$u}{$t}{$ttest} = $tpts; - $comment{$u}{$t}{$ttest} = $cmt; - } - if (!defined($results_merged{$u}{$t}{$ttest_merged}) || $results_merged{$u}{$t}{$ttest_merged} > $tpts) { - $results_merged{$u}{$t}{$ttest_merged} = $tpts; - } - } - close X; - } - foreach my $t (keys %known_tasks) { - $total{$u}{$t} = 0; - foreach my $pts (values %{$results_merged{$u}{$t}}) { $total{$u}{$t} += $pts; } - } -} -print STDERR "OK\n"; - -print STDERR "Creating table template... "; -@header = ("Rank","User","Name"); -@body = ('','$u','$users{$u}'); -@bodysums = (); -@footer = ('"Total"','',''); -if (keys %extra) { - push @header, "Extra"; - push @body, '$extra{$u}'; - $col = 0+@footer; - push @bodysums, $col; - push @footer, "sum($col)"; -} -@tasks = (); -foreach $task (@ARGV) { - my $t = ($task =~ m@/([^/]*)$@) ? $1 : $task; - defined $known_tasks{$t} || die "Unknown task $t"; - push @tasks, $t; - push @header, substr($t, 0, 4); - push @body, "(\$xx = \$total{\$u}{'$t'}) > 0 ? \$xx : 0"; - $col = 0+@footer; - push @footer, "sum($col)"; - push @bodysums, $col; - if ($detail) { - foreach $s (sort { $a <=> $b } keys %{$known_tests{$t}}) { - push @header, "$s"; - push @body, "\$comment{\$u}{'$t'}{'$s'}"; - $col = 0+@footer; - push @footer, "sum($col)"; - } - } -} -push @header, "Total"; -push @body, join('+', map { $_ = "\$$_" } @bodysums); -$col = 0+@footer; -push @footer, "sum($col)"; -print STDERR "OK\n"; - -print STDERR "h: ", join(':',@header), "\n" if $debug; -print STDERR "b: ", join(':',@body), "\n" if $debug; -print STDERR "f: ", join(':',@footer), "\n" if $debug; - -print STDERR "Filling in results... "; -@table = (); -foreach $u (keys %users) { - $row = []; - foreach my $c (@body) { - $c =~ s/\$(\d+)/\$\$row[$1]/g; - $x = eval $c; - push @$row, (defined $x ? $x : '-'); - } - print STDERR "row: ", join(':',@$row), "\n" if $debug; - push @table, $row; -} -print STDERR "OK\n"; - -print STDERR "Sorting... "; -$sortcol = @{$table[0]} - 1; -$namecol = 2; -@table = sort { - my $p, $an, $bn; - $p = $$b[$sortcol] <=> $$a[$sortcol]; - ($an = $$a[$namecol]) =~ s/(\S+)\s+(\S+)/$2 $1/; - ($bn = $$b[$namecol]) =~ s/(\S+)\s+(\S+)/$2 $1/; - $p ? $p : ($an cmp $bn); -} @table; -$i=0; -while ($i < @table) { - $j = $i; - while ($i < @table && ${$table[$i]}[$sortcol] == ${$table[$j]}[$sortcol]) { - $i++; - } - if ($i == $j+1) { - ${table[$j]}[0] = "$i."; - } else { - ${table[$j]}[0] = $j+1 . ".-" . $i . "."; - $j++; - while ($j < $i) { ${table[$j++]}[0] = " "; }; - } -} -print STDERR "OK\n"; - -print STDERR "Attaching headers and footers... "; -sub sum { my $col=shift @_; my $t=0; foreach my $z (0..@table-1) { $t += ${$table[$z]}[$col]; } $t; } -map { $_ = eval $_; } @footer; -push @table, \@footer; -unshift @table, \@header; -print STDERR "OK\n"; - -if ($debug) { - foreach $r (@table) { print join(':',@$r), "\n"; } -} elsif ($html) { - print '', "\n"; - print "Rank list\n"; - print "

Rank list

\n"; - - my @perm; - &printHtmlHeader(\@perm); - print ""; - - foreach $r (@table[1..($#table - 1)]) { - &printHtmlRow(@{$r}[@perm]); - } - - print ""; - &printHtmlRow(@{$table[$#table]}[@perm]); - - print "\n"; - if ($detail) { - print "

Error codes

    \n"; - foreach $r (sort keys %error_codes) { print "
  • $r: $error_codes{$r}\n"; } - print "
\n"; - } - print "\n"; -} elsif ($tex) { - print "\\error{TeX output not supported yet!}\n"; -} else { - foreach $r (@table) { print join("\t",@$r), "\n"; } - if ($print_key) { - print "\n"; - foreach $r (sort keys %error_codes) { print "$r: $error_codes{$r}\n"; } - } -} - -sub printHtmlRow { - print "", join('',map { - if ($hdr) { $_ = "$_"; } - else { $_ = " 14 ? " width=150" : "") . ">$_"; } - } @_), "\n"; -} - -sub printHtmlHeader { - - my ($perm) = @_; - - my $colspec = ""; - my $hdr1; - my $hdr2; - - @$perm = (0, 1, 2); - my $p = 3; - - if ($detail) { - $hdr1 = "RankUserName"; - $extras and $p++ and push @$perm, 3 and $hdr1.="Extra" and $colspec.=""; ##Extra hack - for my $task (@tasks) { - - my $nSub = scalar(keys %{$known_tests{$task}}); - - $p++; - map { push @$perm, $p++ } (1..$nSub); - push @$perm, $p - $nSub - 1; - - $colspec .= "\n"; - $colspec .= "\n"; - $hdr1 .= "$task"; - $hdr2 .= join("", map { "$_" } sort {$a <=> $b} keys %{$known_tests{$task}}); - $hdr2 .= "Total"; - } - - $hdr1 .= "Total"; - - } else { ## no detail - - $hdr1 = "RankUserName"; - $extras and $p++ and push @$perm, 3 and $hdr1.="Extra" and $colspec.=""; ##Extra hack - - for my $task (@tasks) { - push @$perm, $p++; - $hdr1 .= "$task"; - } - $hdr1 .= "Total"; - $colspec .= ""; - } - - push @$perm, $p++; - - print "\n"; - print "$colspec\n"; - print "$hdr1\n"; - print "$hdr2\n" if $detail; - -} - -close STDOUT; diff --git a/mop/patches/fpc/fpc222aborting.desc b/mop/patches/fpc/fpc222aborting.desc deleted file mode 100644 index 84108fb..0000000 --- a/mop/patches/fpc/fpc222aborting.desc +++ /dev/null @@ -1,20 +0,0 @@ -This patch against debian fpc-2.2.2-8 does the following: -When a pascal program is compiled with -gl, then any runtime -error (either internal, caused by caught signal, or runerror()) -dumps the stack and then kills itself by SIGABRT. - -This is to allow catching runtime errors in gdb. - -Details: We want the stack to be as small as possible when sending -SIGABRT. That is why DumpStackAndAbort is a macro and not a function -and why we call syscall using assembly. Another trick we do is -to place abort calls not only in HandleErrorAddrFrame, but in -fpc_rangecheck, fpc_iocheck, fpc_... too. If a rangecheck fails, -the resulting stack trace is: -(gdb) bt -#0 0x08058409 in fpc_rangeerror () -#1 0x08048115 in F (I=0) at testp.pas:13 - -Beware, gdb is not able to decode stack if the abort is called -in HandleErrorAddrFrame. That was another reason why fpc_*chech -methods calls abort themselves, not relying on HandleErrorAddrFrame. diff --git a/mop/patches/fpc/fpc222aborting.patch b/mop/patches/fpc/fpc222aborting.patch deleted file mode 100644 index 1a67243..0000000 --- a/mop/patches/fpc/fpc222aborting.patch +++ /dev/null @@ -1,138 +0,0 @@ ---- fpc-2.2.2/fpcsrc/rtl/inc/system.inc.ori 2009-03-16 16:28:29.000000000 +0100 -+++ fpc-2.2.2/fpcsrc/rtl/inc/system.inc 2009-03-16 18:29:45.000000000 +0100 -@@ -585,27 +585,65 @@ - Miscellaneous - *****************************************************************************} - -+{ MOP 2009 patch: call sigabort when -gl was used in compilation } -+const -+ DontHaltInHandleError : boolean = false; -+ -+function IsCompiledWithGl : boolean; -+begin -+ { -gl modifies BackTraceStrFunc to point to lineinfo unit } -+ IsCompiledWithGl := BackTraceStrFunc <> @SysBackTraceStr; -+end; -+ -+procedure InternalExit; forward; -+{ We define next method as a macro, because we do not want to -+ show it when a stack is dumped. Because of the same reason -+ we call SYSCALL_KILL ourselves in assembler code. } -+{$MACRO ON} -+{$define DumpStackAndAbort:= -+ begin -+ InternalExit; -+ asm -+ movl $20, %eax; { SYSCALL_GETPID as first argument } -+ int $0x80; { GETPID -> eax } -+ movl %eax, %ebx; { PID as second argument } -+ movl $37, %eax; { SYSCALL_KILL as first argument } -+ movl $6, %ecx; { SIGABRT as third argument } -+ int $0x80; { KILL } -+ end; -+ end -+} -+{ MOP 2009 patch ends } -+ - procedure fpc_rangeerror;[public,alias:'FPC_RANGEERROR']; compilerproc; - begin -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(201,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - - - procedure fpc_divbyzero;[public,alias:'FPC_DIVBYZERO']; compilerproc; - begin -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(200,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - - - procedure fpc_overflow;[public,alias:'FPC_OVERFLOW']; compilerproc; - begin -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(215,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - - - procedure fpc_threaderror; [public,alias:'FPC_THREADERROR']; - begin -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(6,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - - -@@ -619,7 +657,9 @@ - begin - l:=HInOutRes^; - HInOutRes^:=0; -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(l,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - end; - -@@ -648,7 +688,9 @@ - begin - if assigned(SafeCallErrorProc) then - SafeCallErrorProc(res,get_frame); -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(229,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - result:=res; - end; -@@ -680,7 +722,9 @@ - if (c <= StackBottom) then - begin - StackError:=true; -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleError(202); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - end; - {$IFDEF STACKCHECK} -@@ -862,6 +906,8 @@ - errorcode:=word(Errno); - erroraddr:=addr; - errorbase:=frame; -+ if DontHaltInHandleError then exit; { MOP 2009 patch } -+ if IsCompiledWithGl then DumpStackAndAbort; { MOP 2009 patch } - {$ifdef FPC_HAS_FEATURE_EXCEPTIONS} - if ExceptAddrStack <> nil then - raise TObject(nil) at addr,frame; -@@ -903,6 +949,7 @@ - errorcode:=w; - erroraddr:=get_caller_addr(get_frame); - errorbase:=get_caller_frame(get_frame); -+ if IsCompiledWithGl then DumpStackAndAbort; { MOP 2009 patch } - {$ifdef FPC_HAS_FEATURE_EXITCODE} - if errorcode <= maxExitCode then - halt(errorcode) -@@ -1148,7 +1195,9 @@ - begin - If pointer(AbstractErrorProc)<>nil then - AbstractErrorProc(); -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(211,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } - end; - - -@@ -1156,8 +1205,11 @@ - begin - if pointer(AssertErrorProc)<>nil then - AssertErrorProc(Msg,FName,LineNo,ErrorAddr) -- else -+ else begin -+ if IsCompiledWithGl then DontHaltInHandleError := true; { MOP 2009 patch } - HandleErrorFrame(227,get_frame); -+ DumpStackAndAbort; { MOP 2009 patch } -+ end - end; - - diff --git a/mop/public/Makefile b/mop/public/Makefile deleted file mode 100644 index 8b0b449..0000000 --- a/mop/public/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile for MO-P contest environment -# (c) 2008 Martin Mares - -DIRS+=mop/public -PROGS+=$(addprefix $(o)/mop/public/,check compile status submit) - -$(o)/mop/public/check: $(s)/mop/public/check.sh -$(o)/mop/public/compile: $(s)/mop/public/compile.sh -$(o)/mop/public/status: $(s)/mop/public/status.sh -$(o)/mop/public/submit: $(s)/mop/public/submit.sh diff --git a/mop/public/check.sh b/mop/public/check.sh deleted file mode 100755 index c82c174..0000000 --- a/mop/public/check.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -# The Evaluator -- Public Checking Script -# (c) 2001--2008 Martin Mares - -set -e -[ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; } -pushd $MO_ROOT >/dev/null -. lib/libeval.sh -. cf/mop -popd >/dev/null - -function usage -{ - die "Usage: check [-s ] []" -} - -SRCFILE= -while getopts "s:" opt ; do - case $opt in - s) SRCFILE="$OPTARG" - ;; - *) usage - ;; - esac -done -shift $(($OPTIND-1)) -[ -n "$1" ] || usage -PROBLEM=$1 -TEST= -shift -if [ -n "$1" ] ; then - TEST="$1" - shift -fi -[ -z "$1" ] || usage - -public-setup -. $PDIR/config - -function test-verdict -{ - pend "$2" - if [ $1 == 0 ] ; then - exit 1 - else - exit 0 - fi -} - -if [ $TASK_TYPE == open-data ] ; then - [ -n "$TEST" ] || die "You need to specify test number for open data problems." - pstart "Checking $TEST: " - test-config - open-locate "$SRCFILE" - try-ln "$SDIR/$SRCN" $TDIR/$TEST.out - syntax-check - test-result $POINTS_PER_TEST OK -else - [ -z "$TEST" ] || die "Test number should be given only for open data problems." - locate-source "$SRCFILE" - compile - RC=0 - for TEST in $SAMPLE_TESTS ; do - ( - pstart "Checking on sample input $TEST: " - test-config - test-run - syntax-check - output-check - ) || RC=1 - done - exit $RC -fi diff --git a/mop/public/compile.sh b/mop/public/compile.sh deleted file mode 100755 index 24731d9..0000000 --- a/mop/public/compile.sh +++ /dev/null @@ -1,37 +0,0 @@ -# The Evaluator -- Public Compilation Script -# (c) 2001 Martin Mares - -set -e -[ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; } -pushd $MO_ROOT >/dev/null -. lib/libeval.sh -. cf/eval -. cf/mop -popd >/dev/null - -[ -n "$1" ] || die "Usage: compile ( | [])" -if [ "${1%%.*}" == "$1" ] ; then - # Compiling problem - PROBLEM=$1 - public-setup - . $PDIR/config - locate-source - if compile ; then - mv $TDIR/$PROBLEM . - else - echo >&2 - sed &2 '1,/^Compiler output:/d;/^Compiler output files:/,$d;/^Exited /d' - fi -else - SRC=$1 - [ -f $SRC ] || die "$SRC doesn't exist" - EXE=${1%%.*} - SRCEXT=${1/*./} - shift - EXTRA_CFLAGS="$@" - CCMD=EXT_${SRCEXT}_COMP - [ -n "${!CCMD}" ] || die "Don't know how to compile $SRC" - CCMD="`eval echo ${!CCMD}`" - echo "$CCMD" - $CCMD -fi diff --git a/mop/public/status.sh b/mop/public/status.sh deleted file mode 100755 index d225760..0000000 --- a/mop/public/status.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# The Evaluator -- Public Status Script -# (c) 2004 Martin Mares - -set -e -[ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; } -pushd $MO_ROOT >/dev/null -. lib/libeval.sh -. cf/mop -popd >/dev/null - -[ -z "$1" ] || die "Usage: status" - -echo -e "Submitted tasks:\n" - -if [ -n "$REMOTE_SUBMIT" ] ; then - exec $MO_ROOT/bin/remote-status -fi - -for PROBLEM in `cd $MO_ROOT/problems/ ; echo *` ; do - ( - PDIR=$MO_ROOT/problems/$PROBLEM - SUBDIR=~/.submit/$PROBLEM - [ -f $PDIR/config ] || exit 0 - echo -n "$PROBLEM: " - . $PDIR/config - if [ -d $SUBDIR ] ; then - if [ $TASK_TYPE == open-data ] ; then - for X in $TESTS ; do - [ -f $SUBDIR/$X.out ] && echo -n "$X " || echo -n "- " - done - echo - else - C=0 - for X in $EXTENSIONS ; do - if [ -f $SUBDIR/$PROBLEM.$X ] ; then - echo -n `basename $SUBDIR/$PROBLEM.$X` - C=$(($C+1)) - fi - done - if [ $C == 0 ] ; then - echo --- - elif [ $C == 1 ] ; then - echo - else - echo "INCONSISTENT (you probably modified $SUBDIR manually)" - fi - fi - else - echo --- - fi - ) -done diff --git a/mop/public/submit.sh b/mop/public/submit.sh deleted file mode 100755 index 25b852b..0000000 --- a/mop/public/submit.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash -# The Evaluator -- Public Submit Script -# (c) 2001--2007 Martin Mares - -set -e -[ -n "$MO_ROOT" -a -d "$MO_ROOT" ] || { echo >&2 "MO_ROOT not set, giving up." ; exit 1 ; } -pushd $MO_ROOT >/dev/null -. lib/libeval.sh -. cf/mop -popd >/dev/null - -function usage -{ - die "Usage: submit [--force] [-s ] []" -} - -FORCE=0 -if [ "$1" = --force ] ; then - FORCE=1 - shift -fi -[ -n "$1" -a "$1" != "--help" ] || usage -SRCFILE= -while getopts "s:" opt ; do - case $opt in - s) SRCFILE="$OPTARG" - ;; - *) usage - ;; - esac -done -shift $(($OPTIND-1)) -[ -n "$1" ] || usage -PROBLEM=$1 -PART= -shift -if [ -n "$1" ] ; then - PART="$1" - shift -fi -[ -z "$1" ] || usage -public-setup -. $PDIR/config - -function test-verdict -{ - pend "$2" - [ $1 == 0 ] && exit 1 || exit 0 -} - -FAILED=0 -if [ $TASK_TYPE == open-data ] ; then - [ -n "$PART" ] || die "You need to specify test number for open data problems." - TEST=$PART - pstart "Test case $TEST: " - open-locate "$SRCFILE" - ( - [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config - try-ln "$SDIR/$SRCN" $TDIR/$TEST.out - syntax-check - test-result $POINTS_PER_TEST OK - ) || FAILED=1 -else - [ -z "$PART" ] || die "Test number should be given only for open data problems." - locate-source "$SRCFILE" - compile - for TEST in $SAMPLE_TESTS ; do - ( - pstart "Checking on sample input $TEST: " - [ -f $PDIR/$TEST.config ] && . $PDIR/$TEST.config - test-run - syntax-check - output-check - die "How could I get there? It's a buuuuug!" - ) || FAILED=$(($FAILED+1)) - done -fi - -if [ $FAILED != 0 ] ; then - if [ $FORCE != 0 ] ; then - echo "Submit forced." - pend "TESTS FAILED, but --force given, so submitting anyway." - else - pend "TESTS FAILED. Nothing has been submitted!" - pend "Use submit --force if you really want to submit an obviously WRONG solution." - exit 1 - fi -fi - -if [ -n "$REMOTE_SUBMIT" ] ; then - pstart "Submitting to the server... " - $MO_ROOT/bin/remote-submit $PROBLEM $PART "$SDIR/$SRCN" - pend "OK" - exit 0 -fi - -pstart "Submitting... " -mkdir -p ~/.submit -if [ $TASK_TYPE == open-data ] ; then - mkdir -p ~/.submit/$PROBLEM - cp "$SDIR/$SRCN" ~/.submit/$PROBLEM/$PART.out -else - rm -rf ~/.submit/$PROBLEM - mkdir -p ~/.submit/$PROBLEM - cp "$SDIR/$SRCN" ~/.submit/$PROBLEM/ -fi -pend "OK" diff --git a/mop/score/Makefile b/mop/score/Makefile deleted file mode 100644 index db1fb75..0000000 --- a/mop/score/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# Makefile for MO-P contest environment -# (c) 2008 Martin Mares - -DIRS+=mop/score -PROGS+=$(addprefix $(o)/mop/score/,mo-score-mop) - -$(o)/mop/score/mo-score-mop: $(s)/mop/score/mo-score-mop.sh diff --git a/mop/score/mo-score-mop.sh b/mop/score/mo-score-mop.sh deleted file mode 100755 index d7aca2e..0000000 --- a/mop/score/mo-score-mop.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; -use List::Util qw(min); - -@ARGV or die "Usage: mo-score-mop task1 task2 ..."; - -print STDERR "Scanning contestants... "; -open (CT, "bin/mo-get-users --full |") || die "Cannot get list of contestants"; -my %users = (); -while () { - chomp; - my ($u, $f) = split /\t/; - $u =~ /^mo/ or next; - $users{$u}=$f; -} -close CT; -print STDERR 0+keys %users, "\n"; - -print STDERR "Scanning task results... "; -my %tasks = (); -for my $u (keys %users) { - for my $t (@ARGV) { - my $tt = "testing/$u/$t/points"; - -f $tt || next; - print STDERR "$u/$t "; - open (X, $tt) || die "Unable to open $tt"; - my %groups = (); - while () { - chomp; - my ($test, $pts) = /^(\S+) (-?\d+)/ or die "Parse error: $_"; - my $group = $test; - $group =~ s{\D}{}g; - if (defined $groups{$group}) { - $groups{$group} = min($groups{$group}, $pts); - } else { - $groups{$group} = $pts; - } - } - close X; - - for my $g (keys %groups) { - $tasks{$u}{$t} += $groups{$g}; - } - } -} -print STDERR "OK\n"; - -print STDERR "Generating output... "; -for my $u (sort keys %users) { - print join("\t", $u, $users{$u}, map { $tasks{$u}{$_} // '-' } @ARGV), "\n"; -} -print STDERR "OK\n"; - -- 2.39.2