summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-06 16:13:32 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-06 16:13:32 +0000
commitb6e145ecd29afd5d59e11b58ad5978760cd81a20 (patch)
tree405eacc355acca4b411f22c2ff3cc05a646057c3 /perl-install/install/pkgs.pm
parent28a90a03bfd0ee0e9e5e5beaa36ee52b0c93dd1e (diff)
downloaddrakx-backup-do-not-use-b6e145ecd29afd5d59e11b58ad5978760cd81a20.tar
drakx-backup-do-not-use-b6e145ecd29afd5d59e11b58ad5978760cd81a20.tar.gz
drakx-backup-do-not-use-b6e145ecd29afd5d59e11b58ad5978760cd81a20.tar.bz2
drakx-backup-do-not-use-b6e145ecd29afd5d59e11b58ad5978760cd81a20.tar.xz
drakx-backup-do-not-use-b6e145ecd29afd5d59e11b58ad5978760cd81a20.zip
(start_pushing_error,popup_errors,error) factorize "background" error handling
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index cf35328d4..b01ae5165 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -371,6 +371,19 @@ sub unselectAllPackages {
_resolve_requested_and_check($packages, $packages->{state}, \%keep_selected);
}
+
+my (@errors, $push_errors);
+sub start_pushing_error() {
+ $push_errors = 1;
+}
+
+sub popup_errors() {
+ if (@errors) {
+ $::o->ask_warn(undef, N("An error occurred:") . "\n\n" . join("\n", @errors));
+ }
+ undef $push_errors;
+}
+
sub empty_packages {
my ($o_keep_unrequested_dependencies) = @_;
my $packages = urpm->new;
@@ -389,6 +402,10 @@ sub empty_packages {
};
$packages->{error} = sub {
log::l("urpmi error: $_[0]");
+ if ($push_errors) {
+ push @errors, @_;
+ return;
+ }
$::o->ask_warn(undef, N("An error occurred:") . "\n\n" . $_[0]);
};
$packages->{root} = $::prefix;