diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | urpm/main_loop.pm | 18 |
2 files changed, 15 insertions, 5 deletions
@@ -1,4 +1,6 @@ - fix testsuite regressions +- urpmi: + o heavy refactorization - urpmf: o fix -m option not showing media names (mga#5916) 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 { |