diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-07-08 18:16:43 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-07-08 18:16:43 +0000 |
commit | 71bc780c6c0f5ca856b26f869263b3dbc40ed1c8 (patch) | |
tree | 142c8c4de34b0af1fcb72381f8c858e97962c6d5 /urpm/get_pkgs.pm | |
parent | fa84fb2c2a75f89763fbebc992e5a5317c2a4977 (diff) | |
download | urpmi-71bc780c6c0f5ca856b26f869263b3dbc40ed1c8.tar urpmi-71bc780c6c0f5ca856b26f869263b3dbc40ed1c8.tar.gz urpmi-71bc780c6c0f5ca856b26f869263b3dbc40ed1c8.tar.bz2 urpmi-71bc780c6c0f5ca856b26f869263b3dbc40ed1c8.tar.xz urpmi-71bc780c6c0f5ca856b26f869263b3dbc40ed1c8.zip |
re-indent
Diffstat (limited to 'urpm/get_pkgs.pm')
-rw-r--r-- | urpm/get_pkgs.pm | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 7e768ee4..ecd28e8d 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -216,39 +216,40 @@ sub _download_packages_of_distant_media { my $cachedir = $urpm->{cachedir}; if (! -w "$cachedir/partial") { - if (my $userdir = urpm::userdir($urpm)) { - $cachedir = $userdir; - mkdir "$cachedir/partial"; - mkdir "$cachedir/rpms"; - } else { - $urpm->{fatal}(1, N("Can not download packages into %s", "$cachedir/partial")); - } + if (my $userdir = urpm::userdir($urpm)) { + $cachedir = $userdir; + mkdir "$cachedir/partial"; + mkdir "$cachedir/rpms"; + } else { + $urpm->{fatal}(1, N("Can not download packages into %s", "$cachedir/partial")); } + } + + $urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $blist->{media}{name})); + if (urpm::download::sync($urpm, $blist->{media}, [ values %distant_sources ], + dir => "$cachedir/partial", quiet => $options{quiet}, + resume => $urpm->{options}{resume}, callback => $options{callback})) { + $urpm->{log}(N("...retrieving done")); + } else { + $urpm->{error}(N("...retrieving failed: %s", $@)); + } - $urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $blist->{media}{name})); - if (urpm::download::sync($urpm, $blist->{media}, [ values %distant_sources ], - dir => "$cachedir/partial", quiet => $options{quiet}, - resume => $urpm->{options}{resume}, callback => $options{callback})) { - $urpm->{log}(N("...retrieving done")); + #- clean files that have not been downloaded, but keep in mind + #- 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 $i (keys %distant_sources) { + my ($filename) = $distant_sources{$i} =~ m|/([^/]*\.rpm)$|; + if ($filename && -s "$cachedir/partial/$filename") { + if (my $rpm = verify_partial_rpm_and_move($urpm, $cachedir, $filename)) { + $sources->{$i} = $rpm; } else { - $urpm->{error}(N("...retrieving failed: %s", $@)); - } - #- clean files that have not been downloaded, but keep in mind - #- 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 $i (keys %distant_sources) { - my ($filename) = $distant_sources{$i} =~ m|/([^/]*\.rpm)$|; - if ($filename && -s "$cachedir/partial/$filename") { - if (my $rpm = verify_partial_rpm_and_move($urpm, $cachedir, $filename)) { - $sources->{$i} = $rpm; - } else { - $errors->{$i} = [ $distant_sources{$i}, 'bad' ]; - } - } else { - $errors->{$i} = [ $distant_sources{$i}, 'missing' ]; - } + $errors->{$i} = [ $distant_sources{$i}, 'bad' ]; } + } else { + $errors->{$i} = [ $distant_sources{$i}, 'missing' ]; + } + } } 1; |