From 318b422a58703c1665ddec419d3b5f4b03ccb34d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 23 Jun 2012 06:43:28 +0000 Subject: (setPackages) show all errors at once when setting media --- perl-install/install/NEWS | 1 + perl-install/install/any.pm | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'perl-install/install') diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 291d3e4b8..f9a5da586 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,4 @@ +- show all errors at once when setting media - fix settings 'suggests' properly according to 'no_suggests' (aka default to suggests enabled) regression intoduced in 14.23 diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm index 401fae702..89c0b0b14 100644 --- a/perl-install/install/any.pm +++ b/perl-install/install/any.pm @@ -322,13 +322,23 @@ sub setPackages { my $media = $o->{media} || [ { type => 'media_cfg', url => 'drakx://media' } ]; - my ($suppl_method, $copy_rpms_on_disk) = install::media::get_media($o, $media, $o->{packages}); - - if ($suppl_method) { - 1 while $o->selectSupplMedia; + { + my @errors; + local $::o->{packages}{error} = sub { + log::l("urpmi error: $_[0]"); + push @errors, @_; + }; + my ($suppl_method, $copy_rpms_on_disk) = install::media::get_media($o, $media, $o->{packages}); + + if ($suppl_method) { + 1 while $o->selectSupplMedia; + } + install::media::configure_media($o->{packages}); + if (@errors) { + $::o->ask_warn(undef, N("An error occurred:") . "\n\n" . join("\n", @errors)); + } } - install::media::configure_media($o->{packages}); install::media::adjust_paths_in_urpmi_cfg($o->{packages}); log::l('urpmi completely set up'); -- cgit v1.2.1