commit 8a15c85fcfc0ab16134096dc3a1996119c5c6ab8 Author: Christophe Fergeau Date: Mon Oct 5 10:45:25 2009 +0200 download all packages first diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index d8a7ce4..42bcadb 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -60,6 +60,47 @@ urpm::cdrom::copy_packages_of_removable_media($urpm, $callbacks->{copy_removable}); $callbacks->{post_removable} and $callbacks->{post_removable}->(); +my $download_everything_first = 1; +if ($download_everything_first) { + print "Downloading everything!\n"; + my @error_sources; + urpm::get_pkgs::download_packages_of_distant_media($urpm, + $blists, + \%sources, + \@error_sources, + quiet => $options{verbose} < 0, + callback => $callbacks->{trans_log}, + ask_retry => !$urpm->{options}{auto} && ($callbacks->{ask_retry} || sub { + my ($raw_msg, $msg) = @_; + if (my $download_errors = delete $urpm->{download_errors}) { + $raw_msg = join("\n", @$download_errors, ''); + } + $callbacks->{ask_yes_or_no}('', $raw_msg . "\n" . $msg . "\n" . N("Retry?")); + }), + ); + if (@error_sources) { + $_->[0] = urpm::download::hide_password($_->[0]) foreach @error_sources; + my @bad = grep { $_->[1] eq 'bad' } @error_sources; + my @missing = grep { $_->[1] eq 'missing' } @error_sources; + + my @msgs; + if (@missing) { + push @msgs, N("Installation failed, some files are missing:\n%s", + join("\n", map { " $_->[0]" } @missing)) + . "\n" . + #-PO: we silently update the string from "You may want to..." to "You may need to..". + #-PO: so that translations do not got fuzzy-ed just before the release: + N("You may need to update your urpmi database."); + } + if (@bad) { + push @msgs, N("Installation failed, bad rpms:\n%s", + join("\n", map { " $_->[0]" } @bad)); + } + return 10; + } + print "Everything downloaded\n"; +} + #- now create transaction just before installation, this will save user impression of slowness. #- split of transaction should be disabled if --test is used. urpm::install::build_transaction_set_($urpm, $state,