summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-08 18:51:58 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-08 18:51:58 +0000
commitfcbfd1b42dad5092874b2d5c277839ad961e580a (patch)
treec7fcbcd6bad0d86e4434801db321a055805ffdc7
parentd8183b0ed3a781f72789225321ee295516f18e34 (diff)
downloadurpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar
urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar.gz
urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar.bz2
urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.tar.xz
urpmi-fcbfd1b42dad5092874b2d5c277839ad961e580a.zip
(_finish) split it out of run()
-rw-r--r--NEWS2
-rw-r--r--urpm/main_loop.pm18
2 files changed, 15 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 553d7ea4..ee103fbd 100644
--- a/NEWS
+++ b/NEWS
@@ -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 {