diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-10-15 17:11:59 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-10-15 17:11:59 +0000 |
commit | 6381a6079098697ddaba5ff6810a2e87658bca26 (patch) | |
tree | db011c410240daaca7b5da6c32545c8537abf914 /urpm | |
parent | 66e4e44ba0103fa81e3fe23d5d0b36cb460a5753 (diff) | |
download | urpmi-6381a6079098697ddaba5ff6810a2e87658bca26.tar urpmi-6381a6079098697ddaba5ff6810a2e87658bca26.tar.gz urpmi-6381a6079098697ddaba5ff6810a2e87658bca26.tar.bz2 urpmi-6381a6079098697ddaba5ff6810a2e87658bca26.tar.xz urpmi-6381a6079098697ddaba5ff6810a2e87658bca26.zip |
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
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/main_loop.pm | 13 |
1 files changed, 10 insertions, 3 deletions
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; + } + } } } |