diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-24 10:58:31 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-24 10:58:31 +0000 |
commit | 52734f88a237a83a09e9fda07ddd14606a71e062 (patch) | |
tree | 5c4688779cfa5ae799a5ae35a2a7c8e7aeeabe18 /urpm/main_loop.pm | |
parent | aaf182ce4dd27e7ab847e8cf35f1e97210c07be2 (diff) | |
download | urpmi-52734f88a237a83a09e9fda07ddd14606a71e062.tar urpmi-52734f88a237a83a09e9fda07ddd14606a71e062.tar.gz urpmi-52734f88a237a83a09e9fda07ddd14606a71e062.tar.bz2 urpmi-52734f88a237a83a09e9fda07ddd14606a71e062.tar.xz urpmi-52734f88a237a83a09e9fda07ddd14606a71e062.zip |
display a "bad rpms" message instead of "files are missing" when the downloaded rpm is bad.
this adds a new callback for rpmdrake: "bad_rpms"
this modifies the API of urpm::get_pkgs::download_packages_of_distant_media
($error_sources is now { url => reason } instead of { id => url })
Diffstat (limited to 'urpm/main_loop.pm')
-rw-r--r-- | urpm/main_loop.pm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index 6491dab0..0b93be47 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -252,13 +252,19 @@ $callbacks->{completed} and $callbacks->{completed}->(); #- keep a track of error code. my $exit_code = 0; -if (values %error_sources) { - $callbacks->{missing_files_summary} and $callbacks->{missing_files_summary}->(\%error_sources); +if (my @missing = grep { $error_sources{$_} eq 'missing' } keys %error_sources) { + $callbacks->{missing_files_summary} and $callbacks->{missing_files_summary}->({ map { $_ => $_ } @missing }); #- Warning : the following message is parsed in urpm::parallel_* print N("Installation failed, some files are missing:\n%s\nYou may want to update your urpmi database", - join "\n", map { s|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|$1xxxx$2|; " $_" } values %error_sources), "\n"; + join "\n", map { " " . urpm::download::hide_password($_) } @missing), "\n"; $exit_code = 10; } +if (my @bad = grep { $error_sources{$_} eq 'bad' } keys %error_sources) { + $callbacks->{bad_rpms} and $callbacks->{bad_rpms}->(@bad); + print N("Installation failed, bad rpms:\n%s", + join "\n", map { " " . urpm::download::hide_password($_) } @bad), "\n"; + $exit_code = 11; +} if ($nok) { $callbacks->{trans_error_summary} and $callbacks->{trans_error_summary}->($nok, \@errors); $nok > 1 and print P("%d installation transaction failed", |