retry 3 times to download once failing to download 72/279172/1
authorbiao716.wang <biao716.wang@samsung.com>
Wed, 3 Aug 2022 06:18:01 +0000 (15:18 +0900)
committerbiao716.wang <biao716.wang@samsung.com>
Wed, 3 Aug 2022 06:18:01 +0000 (15:18 +0900)
Change-Id: Ifba958d5a69746fe44c8beb874ba93516cb5b8cc
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
download

index 9297e30a1140b9117496af39c4a572564b3bdaa8..6b374d32405e31ec984e8cd18af7f27aea1fff6e 100755 (executable)
--- a/download
+++ b/download
@@ -96,7 +96,7 @@ for my $url (@ARGV) {
     my $res = $ua->mirror($url, $dest);
     last if $res->is_success;
     # if it's a redirect we probably got a bad mirror and should just retry
-       die "reqesting " . hide_passwd($original) . " failed: ".$res->status_line."\n" unless $retry && $res->previous;
+       die "reqesting " . hide_passwd($original) . " failed: ".$res->status_line."\n" unless $retry;
        warn "retrying " . hide_passwd($original) . "\n";
   }
   rename($dest, "$dir/".basename($url->path));