From f504fc034e877525388e62d5ffaf2051e50e4655 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 26 Jun 2008 11:17:10 +0000 Subject: - urpmi o fix displaying "files are missing" (regression introduced in 5.6) --- NEWS | 1 + urpm/get_pkgs.pm | 2 +- urpm/main_loop.pm | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index c5bd924c..d053b402 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ - urpmi: o set connection timeout for rsync as well (Anssi) o fix --replacepkgs when a same package appears more than once in urpmi db + o fix displaying "files are missing" (regression introduced in 5.6) - urpmi.addmedia, urpmi.update: o fix --no-md5sum (regression introduced in 5.20) (#41237) diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 00083205..c489cf21 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -194,7 +194,7 @@ sub download_packages_of_distant_media { #- clean failed download which have succeeded. delete @errors{keys %$sources}; - %$error_sources = map { @$_ } values %errors; + push @$error_sources, values %errors; 1; } diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index c02e6004..aae64045 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -49,7 +49,7 @@ unless ($local_sources || $list) { } my %sources = %$local_sources; -my %error_sources; +my @error_sources; urpm::removable::try_mounting_non_cdroms($urpm, $list); @@ -93,7 +93,7 @@ foreach my $set (@{$state->{transaction} || []}) { urpm::get_pkgs::download_packages_of_distant_media($urpm, \@transaction_list, \%transaction_sources, - \%error_sources, + \@error_sources, quiet => $options{verbose} < 0, callback => $callbacks->{trans_log}, ); @@ -255,17 +255,17 @@ $callbacks->{completed} and $callbacks->{completed}->(); #- keep a track of error code. my $exit_code = 0; -if (my @missing = grep { $error_sources{$_} eq 'missing' } keys %error_sources) { +if (my @missing = grep { $_->[1] eq 'missing' } @error_sources) { $callbacks->{message}->(N("Error"), #- Warning : the following message is parsed in urpm::parallel_* N("Installation failed, some files are missing:\n%s\nYou may want to update your urpmi database", - join "\n", map { " " . urpm::download::hide_password($_) } @missing) . "\n" + join "\n", map { " " . urpm::download::hide_password($_->[0]) } @missing) . "\n" ); $exit_code = 10; } -if (my @bad = grep { $error_sources{$_} eq 'bad' } keys %error_sources) { +if (my @bad = grep { $_->[1] eq 'bad' } @error_sources) { $callbacks->{message}->(N("Error"), N("Installation failed, bad rpms:\n%s", - join "\n", map { " " . urpm::download::hide_password($_) } @bad) . "\n"); + join "\n", map { " " . urpm::download::hide_password($_->[0]) } @bad) . "\n"); $exit_code = 11; } if ($nok) { -- cgit v1.2.1