diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:51:58 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:51:58 +0000 |
commit | fcbfd1b42dad5092874b2d5c277839ad961e580a (patch) | |
tree | c7fcbcd6bad0d86e4434801db321a055805ffdc7 /urpm/main_loop.pm | |
parent | d8183b0ed3a781f72789225321ee295516f18e34 (diff) | |
download | urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar.gz urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar.bz2 urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar.xz urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.zip |
(_finish) split it out of run()
Diffstat (limited to 'urpm/main_loop.pm')
-rw-r--r-- | urpm/main_loop.pm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index 65b9d358..e03e2976 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -404,13 +404,21 @@ sub run { $callbacks->{completed} and $callbacks->{completed}->(); + _finish($urpm, $state, $callbacks, \@errors, \@formatted_errors, $ask_unselect, $something_was_to_be_done); + + $exit_code; +} + +sub _finish { + my ($urpm, $state, $callbacks, $errors, $formatted_errors, $ask_unselect, $something_was_to_be_done) = @_; + if ($nok) { - $callbacks->{trans_error_summary} and $callbacks->{trans_error_summary}->($nok, \@errors); - if (@formatted_errors) { - $urpm->{print}(join("\n", @formatted_errors)); + $callbacks->{trans_error_summary} and $callbacks->{trans_error_summary}->($nok, $errors); + if (@$formatted_errors) { + $urpm->{print}(join("\n", @$formatted_errors)); } - if (@errors) { - $urpm->{print}(N("Installation failed:") . join("\n", map { "\t$_" } @errors)); + if (@$errors) { + $urpm->{print}(N("Installation failed:") . join("\n", map { "\t$_" } @$errors)); } $exit_code ||= $ok ? 11 : 12; } else { |