]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
cs-bisection-step: Refactor $subjobs calculations a bit
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 15:20:09 +0000 (15:20 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Tue, 12 Jun 2018 15:20:12 +0000 (15:20 +0000)
Parse the runvar name earlier, adding job and orgflight members to the
row hashes we got from the db.  This slightly unifies the call to
preparejob, but more relevantly, makes the effective job and flight
information available earlier.  That will be useful in a moment.

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cs-bisection-step

index 0d0e08f5db78ccc3d200197e690f5f17745305ea..01ee6e55793504e76300287e9a8bd37efef537e4 100755 (executable)
@@ -1197,6 +1197,17 @@ END
     my $subjobs= $jobq->fetchall_arrayref( {} );
     $jobq->finish();
 
+    foreach my $subjob (@$subjobs) {
+        my $jobspec= $subjob->{val};
+        if ($jobspec =~ m/^(\d+)\.(.+)$/) {
+            $subjob->{job}       = $2;
+            $subjob->{orgflight} = $1;
+        } else {
+            $subjob->{job}       = $jobspec;
+            $subjob->{orgflight} = $copyflight;
+        }
+    }
+
     # See if there's a build we can reuse
 
     my ($recipe) = $dbh_tests->selectrow_array(<<END,{}, $copyflight,$popjob);
@@ -1277,12 +1288,7 @@ END
 END
     foreach my $subjob (@$subjobs) {
         my $target;
-        my $jobspec= $subjob->{val};
-        if ($jobspec =~ m/^(\d+)\.(.+)$/) {
-            $target= preparejob($2, $1, 1);
-        } else {
-            $target= preparejob($jobspec, $copyflight, 1);
-        }
+        $target= preparejob($subjob->{job}, $subjob->{orgflight}, 1);
         $jobsetq->execute($target, $popflight, $popjob, $subjob->{name});
     }
     $jobsetq->finish();