Add contest support to filesystem infiles/okfiles
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 10 Feb 2014 21:18:51 +0000 (23:18 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 10 Feb 2014 21:19:01 +0000 (23:19 +0200)
lib/Gruntmaster/Daemon/Generator/File.pm
lib/Gruntmaster/Daemon/Runner/File.pm

index fb1dc5e..8c2ed5b 100644 (file)
@@ -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'
   }
 }
 
index 34ea04d..7f67fb3 100644 (file)
@@ -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+//;
This page took 0.028054 seconds and 4 git commands to generate.