From 4b06c49abb447e55418ed8d81d47718ef6b47480 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 12 Jun 2018 15:20:09 +0000 Subject: [PATCH] cs-bisection-step: Refactor $subjobs calculations a bit 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 --- cs-bisection-step | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 0d0e08f..01ee6e5 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -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(<{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(); -- 2.39.5