diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-07-08 19:37:43 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-07-08 19:37:43 +0000 |
commit | b899cb44370cd85a650fb00975b67e7b825d6073 (patch) | |
tree | 43226d166e5a30c9ed28346e71ee5787b5e9e769 /urpm/get_pkgs.pm | |
parent | 576b4e766e0dd95d2601f2eaf160021503e443e1 (diff) | |
download | urpmi-b899cb44370cd85a650fb00975b67e7b825d6073.tar urpmi-b899cb44370cd85a650fb00975b67e7b825d6073.tar.gz urpmi-b899cb44370cd85a650fb00975b67e7b825d6073.tar.bz2 urpmi-b899cb44370cd85a650fb00975b67e7b825d6073.tar.xz urpmi-b899cb44370cd85a650fb00975b67e7b825d6073.zip |
migrate _download_packages_of_distant_media() to use blist->{pkgs} instead of blist->{list}
Diffstat (limited to 'urpm/get_pkgs.pm')
-rw-r--r-- | urpm/get_pkgs.pm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 682fe20d..726b244f 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -176,7 +176,7 @@ sub download_packages_of_distant_media { #- get back all ftp and http accessible rpm files into the local cache foreach my $blist (@$blists) { - my %blist_distant = (%$blist, list => {}); + my %blist_distant = (%$blist, pkgs => {}); #- examine all files to know what can be indexed on multiple media. while (my ($id, $url) = each %{$blist->{list}}) { @@ -190,13 +190,13 @@ sub download_packages_of_distant_media { $errors{$id} = [ $local_file, 'missing' ]; } } elsif ($url =~ m!^([^:]*):/(.*/([^/]*\.rpm))\Z!) { - $blist_distant{list}{$id} = "$1:/$2"; #- will download now + $blist_distant{pkgs}{$id} = $blist->{pkgs}{$id}; } else { $urpm->{error}(N("malformed URL: [%s]", $url)); } } - if (%{$blist_distant{list}}) { + if (%{$blist_distant{pkgs}}) { _download_packages_of_distant_media($urpm, $sources, \%errors, \%blist_distant, %options); } } @@ -225,7 +225,7 @@ sub _download_packages_of_distant_media { } $urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $blist->{media}{name})); - if (urpm::download::sync($urpm, $blist->{media}, [ values %{$blist->{list}} ], + if (urpm::download::sync($urpm, $blist->{media}, [ urpm::blist_to_urls($blist) ], dir => "$cachedir/partial", quiet => $options{quiet}, resume => $urpm->{options}{resume}, callback => $options{callback})) { $urpm->{log}(N("...retrieving done")); @@ -237,9 +237,10 @@ sub _download_packages_of_distant_media { #- there have been problems downloading them at least once, this #- is necessary to keep track of failing downloads in order to #- present the error to the user. - foreach my $id (keys %{$blist->{list}}) { - my $url = $blist->{list}{$id}; - my ($filename) = $url =~ m|/([^/]*\.rpm)$|; + foreach my $id (keys %{$blist->{pkgs}}) { + my $pkg = $blist->{pkgs}{$id}; + my $filename = $pkg->filename; + my $url = urpm::blist_pkg_to_url($blist, $pkg); if ($filename && -s "$cachedir/partial/$filename") { if (my $rpm = verify_partial_rpm_and_move($urpm, $cachedir, $filename)) { $sources->{$id} = $rpm; |