diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-03-25 23:29:10 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-03-25 23:29:10 +0000 |
commit | a61311b48af6dcae2165e230ce91bf77706b6f85 (patch) | |
tree | 8747f2ccdb7f57146f0929ac8ca97ad59e963636 /lib/Iurt | |
parent | d2a990deef3a0f20bde73fdd409b75724393277b (diff) | |
download | iurt-a61311b48af6dcae2165e230ce91bf77706b6f85.tar iurt-a61311b48af6dcae2165e230ce91bf77706b6f85.tar.gz iurt-a61311b48af6dcae2165e230ce91bf77706b6f85.tar.bz2 iurt-a61311b48af6dcae2165e230ce91bf77706b6f85.tar.xz iurt-a61311b48af6dcae2165e230ce91bf77706b6f85.zip |
(handle_wait_regexp) split it out of perform_command()
Diffstat (limited to 'lib/Iurt')
-rw-r--r-- | lib/Iurt/Process.pm | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/lib/Iurt/Process.pm b/lib/Iurt/Process.pm index e799376..294c3e6 100644 --- a/lib/Iurt/Process.pm +++ b/lib/Iurt/Process.pm @@ -162,6 +162,28 @@ sub handle_command_error { return 0; } +sub handle_wait_regexp { + my ($run, $config, $comment, $output, %opt) = @_; + my $inc; + foreach my $wr (keys %{$opt{wait_regexp}}) { + if ($output =~ /$wr/m) { + if (ref $opt{wait_regexp}{$wr}) { + $inc = $opt{wait_regexp}{$wr}(\%opt, $output); + } + plog('ERROR', "ERROR: $wr !"); + + if ($opt{wait_mail}) { + sendmail($config->{admin}, '' , + "$opt{hash} on $run->{my_arch} for $run->{media}: could not proceed", + "$wr\n\n$comment\n$output", + "Iurt the rebuild bot <$config->{admin}>", + $opt{debug_mail}, $config); + } + } + } + $inc; +} + =head2 perform_command($command, $run, $config, $cache, %opt) Run a command and check various running parameters such as log size, timeout... @@ -293,22 +315,7 @@ sub perform_command { my $inc; if ($opt{wait_regexp}) { - foreach my $wr (keys %{$opt{wait_regexp}}) { - if ($output =~ /$wr/m) { - if (ref $opt{wait_regexp}{$wr}) { - $inc = $opt{wait_regexp}{$wr}(\%opt, $output); - } - plog('ERROR', "ERROR: $wr !"); - - if ($opt{wait_mail}) { - sendmail($config->{admin}, '' , - "$opt{hash} on $run->{my_arch} for $run->{media}: could not proceed", - "$wr\n\n$comment\n$output", - "Iurt the rebuild bot <$config->{admin}>", - $opt{debug_mail}, $config); - } - } - } + $inc = handle_wait_regexp($run, $config, $comment, $output, %opt); } if ($inc && $try < $max_retry) { |