From 6381a6079098697ddaba5ff6810a2e87658bca26 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Thu, 15 Oct 2009 17:11:59 +0000 Subject: in download-all mode, download packages one by one This is to make sure that already downloaded packages aren't downloaded again if urpmi were to restart for whatever reason --- urpm/main_loop.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'urpm') diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index 22da242a..fdcff529 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -108,9 +108,16 @@ if ($urpm->{options}{'download-all'}) { } } - my ($error_sources) = download_packages($blists, \%sources); - if (@$error_sources) { - return 10; + #download packages one by one so that we don't try to download them again + #and again if the user has to restart urpmi because of some failure + foreach my $blist (@$blists) { + foreach my $pkg (keys %{$blist->{pkgs}}) { + my $blist_one = [{ pkgs => { $pkg => $blist->{pkgs}{$pkg} }, medium => $blist->{medium} }]; + my ($error_sources) = download_packages($blist_one, \%sources); + if (@$error_sources) { + return 10; + } + } } } -- cgit v1.2.1