From 4f1973e21f577f0e908d722421f2c61135ab9704 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 10 Mar 2005 14:29:10 +0000 Subject: Add a retry option to urpmi and urpmi.cfg (bug #1174) --- urpm/args.pm | 1 + urpm/cfg.pm | 1 + urpm/download.pm | 3 +++ 3 files changed, 5 insertions(+) (limited to 'urpm') diff --git a/urpm/args.pm b/urpm/args.pm index bc90e660..84c62cfe 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -85,6 +85,7 @@ my %options_spec = ( curl => sub { $urpm->{options}{downloader} = 'curl' }, 'limit-rate=s' => sub { $urpm->{options}{'limit-rate'} = $_[1] }, 'resume!' => sub { $urpm->{options}{resume} = $_[1] }, + 'retry=s' => sub { $urpm->{options}{retry} = $_[1] }, 'proxy=s' => sub { my (undef, $value) = @_; my ($proxy, $port) = $value =~ m,^(?:http://)?([^:/]+(:\d+)?)/*$, diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 7fad1eed..bf3baea8 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -148,6 +148,7 @@ sub load_config ($;$) { |split-(?:level|length) |priority-upgrade |downloader + |retry )\s*:\s*['"]?(.*?)['"]?$/x and $config{$medium}{$1} = $2, next; /^key[-_]ids\s*:\s*['"]?(.*?)['"]?$/ diff --git a/urpm/download.pm b/urpm/download.pm index bcbc9105..3ce9ffde 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -192,6 +192,7 @@ sub sync_wget { ($options->{limit_rate} ? "--limit-rate=$options->{limit_rate}" : ()), ($options->{resume} ? "--continue" : ()), ($options->{proxy} ? set_proxy({ type => "wget", proxy => $options->{proxy} }) : ()), + ($options->{retry} ? ('-t', $options->{retry}) : ()), ($options->{callback} ? ("--progress=bar:force", "-o", "-") : $options->{quiet} ? "-q" : @{[]}), "--retr-symlinks", @@ -266,6 +267,7 @@ sub sync_curl { open my $curl, join(" ", map { "'$_'" } "/usr/bin/curl", ($options->{limit_rate} ? ("--limit-rate", $options->{limit_rate}) : ()), ($options->{proxy} ? set_proxy({ type => "curl", proxy => $options->{proxy} }) : ()), + ($options->{retry} ? ('--retry', $options->{retry}) : ()), "--stderr", "-", # redirect everything to stdout "--disable-epsv", "--connect-timeout", $CONNECT_TIMEOUT, @@ -323,6 +325,7 @@ sub sync_curl { ($options->{limit_rate} ? ("--limit-rate", $options->{limit_rate}) : ()), ($options->{resume} ? ("--continue-at", "-") : ()), ($options->{proxy} ? set_proxy({ type => "curl", proxy => $options->{proxy} }) : ()), + ($options->{retry} ? ('--retry', $options->{retry}) : ()), ($options->{quiet} && !$options->{verbose} ? "-s" : @{[]}), "-k", $location_trusted ? "--location-trusted" : @{[]}, -- cgit v1.2.1