From: Marius Gavrilescu Date: Mon, 10 Feb 2014 21:18:51 +0000 (+0200) Subject: Add contest support to filesystem infiles/okfiles X-Git-Tag: 5999.000_002~5 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=07d71f40d79d16bd14d446a67a3b50ce6b97cd7e;p=gruntmaster-daemon.git Add contest support to filesystem infiles/okfiles --- diff --git a/lib/Gruntmaster/Daemon/Generator/File.pm b/lib/Gruntmaster/Daemon/Generator/File.pm index fb1dc5e..8c2ed5b 100644 --- a/lib/Gruntmaster/Daemon/Generator/File.pm +++ b/lib/Gruntmaster/Daemon/Generator/File.pm @@ -18,7 +18,8 @@ sub generate{ if (exists $meta->{infile}) { write_file 'input', $meta->{infile}[$test - 1] } else { - copy "/var/lib/gruntmasterd/pb/$meta->{problem}/$test.in", 'input' + my $ct = defined $Gruntmaster::Data::contest ? "ct/$Gruntmaster::Data::contest" : ''; + copy "/var/lib/gruntmasterd/$ct/pb/$meta->{problem}/$test.in", 'input' } } diff --git a/lib/Gruntmaster/Daemon/Runner/File.pm b/lib/Gruntmaster/Daemon/Runner/File.pm index 34ea04d..7f67fb3 100644 --- a/lib/Gruntmaster/Daemon/Runner/File.pm +++ b/lib/Gruntmaster/Daemon/Runner/File.pm @@ -21,7 +21,8 @@ sub run{ if (exists $meta->{okfile}) { $ok = $meta->{okfile}[$test - 1] } else { - $ok = slurp "/var/lib/gruntmasterd/pb/$meta->{problem}/$test.ok" + my $ct = defined $Gruntmaster::Data::contest ? "ct/$Gruntmaster::Data::contest" : ''; + $ok = slurp "/var/lib/gruntmasterd/$ct/pb/$meta->{problem}/$test.ok" } $out =~ s/^\s+//;