+ given ($stat) {
+ when ('OK') {
+ $active_jobs--;
+ $done_jobs++;
+ $host_active_jobs{$mach}--;
+ $host_done_jobs{$mach}++;
+ }
+ when (['FAILED', 'INTERR', 'NOPING', 'PREPFAIL']) {
+ $active_jobs--;
+ $failed_jobs++;
+ $host_active_jobs{$mach}--;
+ $host_failed_jobs{$mach}++;
+ $host_last_fail_job{$mach} = $jid;
+ $host_last_fail_stat{$mach} = $stat;
+ }
+ when ('DONE') {
+ $active_hosts--;
+ if ($host_failed_jobs{$mach}) {
+ $failed_hosts++;
+ } else {
+ $done_hosts++;
+ }
+ }
+ when ('INIT') {
+ if (defined $jid) {
+ $active_hosts++;
+ } else {
+ $active_jobs++;
+ $host_active_jobs{$mach}++;
+ }
+ }
+ when ('LOCKED') {
+ if ($jid eq '-') {
+ $failed_jobs += $job_counter{$mach};
+ $host_failed_jobs{$mach} += $job_counter{$mach};
+ } else {
+ $active_jobs--;
+ $failed_jobs++;
+ $host_active_jobs{$mach}--;
+ $host_failed_jobs{$mach}++;
+ $host_last_fail_job{$mach} = $jid;
+ $host_last_fail_stat{$mach} = $stat;
+ }
+ }
+ when (['START', 'PING', 'SEND', 'RUN']) {
+ }
+ default {
+ $ui->err("Received unknown job status $stat");
+ }
+ }