summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-02 13:10:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-02 13:10:42 +0000
commit03273c8e491556fb830ddefe99acb66169360197 (patch)
treea9bfce9440cf5005ca8ad3f155966f0fbffd18d6
parent50bab642da671578925676f2926ac3194e15f36a (diff)
downloadurpmi-03273c8e491556fb830ddefe99acb66169360197.tar
urpmi-03273c8e491556fb830ddefe99acb66169360197.tar.gz
urpmi-03273c8e491556fb830ddefe99acb66169360197.tar.bz2
urpmi-03273c8e491556fb830ddefe99acb66169360197.tar.xz
urpmi-03273c8e491556fb830ddefe99acb66169360197.zip
- call aria2 with brand-new --uri-selector=adaptive
and use options that makes it work nicely
-rw-r--r--NEWS2
-rw-r--r--urpm/download.pm9
2 files changed, 9 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index ed61b17e..4bafb4ed 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- call aria2 with brand-new --uri-selector=adaptive
+
Version 6.5 - 1 September 2008, Thierry Vignaud
- all tools
diff --git a/urpm/download.pm b/urpm/download.pm
index c6a8381a..82d707f4 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -610,6 +610,8 @@ sub sync_aria2 {
(my $cwd) = getcwd() =~ /(.*)/;
chdir $options->{dir};
+ my $stat_file = ($ENV{HOME} || '/root') . '/.aria2-adaptive-stats';
+
my @files = uniq(map {
my $metalinkfile = $_;
$metalinkfile =~ s/metalink:.*/metalink/;
@@ -618,10 +620,13 @@ sub sync_aria2 {
my $aria2c_command = join(" ", map { "'$_'" }
"/usr/bin/aria2c",
- "--timeout", $CONNECT_TIMEOUT,
"--auto-file-renaming=false",
"--follow-metalink=mem",
- '--metalink-enable-unique-protocol=true',
+ '--metalink-enable-unique-protocol=false', # so that it can try both ftp and http access on the same server. aria2 will only do this on first calls
+ '--max-tries=1',
+ '--lowest-speed-limit=20K', "--timeout", 3, # $CONNECT_TIMEOUT,
+ '-C3', # maximum number of servers to use for one download
+ '--uri-selector=adaptive', "--server-stat-if=$stat_file", "--server-stat-of=$stat_file",
"-Z", "-j1",
($options->{'limit-rate'} ? "--max-download-limit=" . $options->{'limit-rate'} : ()),
($options->{resume} ? "--continue" : "--allow-overwrite=true"),