From: Martin Mares Date: Thu, 28 Jun 2007 18:31:34 +0000 (+0200) Subject: Added the show-submits utility. X-Git-Tag: python-dummy-working~335 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=d047668d020b301d034f0acd7f2873e926bba6e1;p=eval.git Added the show-submits utility. --- diff --git a/bin/mo-create-submit b/bin/mo-create-submit index d334d1f..573d658 100755 --- a/bin/mo-create-submit +++ b/bin/mo-create-submit @@ -16,14 +16,16 @@ cp $H/certs/ca-cert.pem certs/ rm -rf submit mkdir -p submit -cp $H/submit/submitd submit/ -cp $H/submit/config submit/ +cp $H/submit/{submitd,config,show-submits} submit/ mkdir -p solutions for a in `cd $H && bin/mo-get-users` ; do mkdir -p solutions/$a done +rm -rf lib +cp -a $H/submit/lib lib + rm -rf tmp mkdir -p tmp diff --git a/submit/show-submits b/submit/show-submits new file mode 100755 index 0000000..ffc8aad --- /dev/null +++ b/submit/show-submits @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use lib "lib/perl5"; +use Sherlock::Object; + +foreach my $user (split /\s+/,`cd solutions && echo *`) { + print "$user:\t"; + if (open S, "solutions/$user/status") { + my @status = (); + my $s = new Sherlock::Object; + $s->read(\*S) or die "Cannot load status"; + foreach my $t ($s->getarray("(T")) { + my $task = $t->get("T"); + foreach my $p ($t->getarray("(P")) { + my $part = $p->get("P"); + my $ver = $p->get("V"); + my $name = $task . ($part eq $task ? "" : "/$part"); + push @status, "$name(v$ver)"; + } + } + close S; + print join(" ", @status), "\n"; + } else { + print "---\n"; + } +}