summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-23 14:48:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-23 14:48:49 +0000
commit81c5d67c1fc54af53d27ebccc8cb9051eb09daa3 (patch)
treeb738edb69ab4e72b7fa06a4c3c46fa50765758a1 /urpm/download.pm
parent901b8371ac3c864fe1cdbc7067020a99c27e9fa6 (diff)
downloadurpmi-81c5d67c1fc54af53d27ebccc8cb9051eb09daa3.tar
urpmi-81c5d67c1fc54af53d27ebccc8cb9051eb09daa3.tar.gz
urpmi-81c5d67c1fc54af53d27ebccc8cb9051eb09daa3.tar.bz2
urpmi-81c5d67c1fc54af53d27ebccc8cb9051eb09daa3.tar.xz
urpmi-81c5d67c1fc54af53d27ebccc8cb9051eb09daa3.zip
- urpmi, gurpmi
o retry once on aria2 versioned-file download failure
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index d7387645..54ceb4db 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -687,9 +687,16 @@ sub sync_aria2 {
chdir $cwd;
if (!close $aria2) {
my $raw_msg = _error_msg('aria2');
- my $msg = N("Failed to download %s", $rel_files->[0]);
- if ($options->{ask_retry} && $options->{ask_retry}($raw_msg, $msg)) {
- $options->{is_retry} = 1;
+ my $want_retry;
+ if (!$options->{is_retry} & $options->{is_versioned}) {
+ $want_retry = 1;
+ } else {
+ my $msg = N("Failed to download %s", $rel_files->[0]);
+ $want_retry = $options->{ask_retry} && $options->{ask_retry}($raw_msg, $msg);
+ }
+ if ($want_retry) {
+ $options->{is_retry}++;
+ $options->{debug} and $options->{debug}("retrying ($options->{is_retry})");
goto &sync_aria2;
}
die $raw_msg;
@@ -713,7 +720,7 @@ sub _parse_aria2_output {
$medium->{mirrorlist} . ': ' . $medium->{'with-dir'} . "/$rel_files->[0]" :
"$medium->{url}/$rel_files->[0]";
propagate_sync_callback($options, 'start', $file)
- if !delete $options->{is_retry};
+ if !$options->{is_retry};
}
if ($buf =~ m!^\[#\d*\s+\S+:([\d\.]+\w*).([\d\.]+\w*)\S([\d]+)\S+\s+\S+\s*([\d\.]+)\s\w*:([\d\.]+\w*/\w)\s\w*:(\d+\w*)\]$!) {
my ($total, $percent, $speed, $eta) = ($2, $3, $5, $6);
@@ -727,6 +734,7 @@ sub _parse_aria2_output {
if ($buf =~ m!Download\scomplete:\s\./!) {
propagate_sync_callback($options, 'end', $file);
shift @$rel_files;
+ delete $options->{is_retry};
$file = undef;
} elsif ($buf =~ /ERR\|(.*)/) {
propagate_sync_callback($options, 'error', $file, $1);