diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-01-09 14:41:49 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-01-09 14:41:49 +0000 |
commit | fd71fc58b8a72fbe26077849e65efaddadbd1b51 (patch) | |
tree | 0f107703644d436934ec9bfe91fcd6ed60dc51d8 | |
parent | ada800b45d5e50ee767b3f53b7f240ce59c9711a (diff) | |
download | urpmi-fd71fc58b8a72fbe26077849e65efaddadbd1b51.tar urpmi-fd71fc58b8a72fbe26077849e65efaddadbd1b51.tar.gz urpmi-fd71fc58b8a72fbe26077849e65efaddadbd1b51.tar.bz2 urpmi-fd71fc58b8a72fbe26077849e65efaddadbd1b51.tar.xz urpmi-fd71fc58b8a72fbe26077849e65efaddadbd1b51.zip |
Don't modify _download_packages_of_distant_media args, use return values
-rw-r--r-- | urpm/get_pkgs.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 30f8f0fb..d0cb60f1 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -195,7 +195,9 @@ sub download_packages_of_distant_media { } if (%{$blist_distant{pkgs}}) { - _download_packages_of_distant_media($urpm, $sources, \%errors, \%blist_distant, %options); + my ($remote_sources, $remote_errors) = _download_packages_of_distant_media($urpm, \%blist_distant, %options); + put_in_hash ($sources, $remote_sources); + put_in_hash (\%errors, $remote_errors); } } @@ -210,9 +212,10 @@ sub download_packages_of_distant_media { # download packages listed in $blist, # and put the result in $sources or $errors sub _download_packages_of_distant_media { - my ($urpm, $sources, $errors, $blist, %options) = @_; + my ($urpm, $blist, %options) = @_; my $cachedir = urpm::valid_cachedir($urpm); + my (%sources, %errors); $urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $blist->{medium}{name})); if (urpm::download::sync_rel($urpm, $blist->{medium}, [ urpm::blist_to_filenames($blist) ], @@ -236,14 +239,15 @@ sub _download_packages_of_distant_media { 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; + $sources{$id} = $rpm; } else { - $errors->{$id} = [ $url, 'bad' ]; + $errors{$id} = [ $url, 'bad' ]; } } else { - $errors->{$id} = [ $url, 'missing' ]; + $errors{$id} = [ $url, 'missing' ]; } } + (\%sources, \%errors) } 1; |