From 07d71f40d79d16bd14d446a67a3b50ce6b97cd7e Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 10 Feb 2014 23:18:51 +0200 Subject: [PATCH] Add contest support to filesystem infiles/okfiles --- lib/Gruntmaster/Daemon/Generator/File.pm | 3 ++- lib/Gruntmaster/Daemon/Runner/File.pm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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+//; -- 2.39.2