I try to make my emerge use aria2c to enable segmented downloading.
My make.conf
GENTOO_MIRRORS="http://files.gentoo.gr http://ftp.ntua.gr/pub/linux/gentoo http://ftp.cc.uoc.gr/mirrors/linux/gentoo http://mirrors.linuxant.fr/distfiles.gentoo.org http://gentoo.wheel.sk "
FETCHCOMMAND="/usr/bin/aria2c -j5 --connect-timeout=5 -t5 --lowest-speed-limit=100K -x5 -d \${DISTDIR} -o \"\${FILE}\" ${GENTOO_MIRRORS// //\${FILE} }"
RESUMECOMMAND="/usr/bin/aria2c -c -j5 --connect-timeout=5 -t5 --lowest-speed-limit=100K -x5 -d \"\${DISTDIR}\" -o \"\${FILE}\" ${GENTOO_MIRRORS// //\${FILE} }"
Notice that in GENTOO_MIRRORS I did not escape the $, because it would not find the variable at all.
As for the trick with GENTOO_MIRRORS:
Code: Select all
localhost ~ # echo $U
mirror1 mirror2 mirror3 mirror4 mirror5
localhost ~ # echo ${U// //file }
mirror1/file mirror2/file mirror3/file mirror4/file mirror5/file
I get this:
Code: Select all
>>> Emerging (1 of 1) x11-base/xorg-server-1.11.1-r1
!!! FETCHCOMMAND does not contain the required ${FILE} parameter.
!!! RESUMECOMMAND does not contain the required ${FILE} parameter.
!!! Refer to the make.conf(5) man page for information about how to
!!! correctly specify FETCHCOMMAND and RESUMECOMMAND.
>>> Downloading 'http://files.gentoo.gr/distfiles/xorg-server-1.11.1.tar.bz2'
Traceback (most recent call last):
File "/usr/lib64/portage/pym/_emerge/EbuildFetcher.py", line 186, in _spawn
allow_missing_digests=allow_missing):
File "/usr/lib64/portage/pym/portage/package/ebuild/fetch.py", line 957, in fetch
myret = _spawn_fetch(mysettings, myfetch)
File "/usr/lib64/portage/pym/portage/package/ebuild/fetch.py", line 89, in _spawn_fetch
rval = spawn_func(args, env=settings.environ(), **kwargs)
File "/usr/lib64/portage/pym/portage/process.py", line 203, in spawn
binary = mycommand[0]
IndexError: list index out of range
* Fetch failed for 'x11-base/xorg-server-1.11.1-r1', Log file:
* '/var/log/portage/x11-base:xorg-server-1.11.1-r1:20111024-184210.log'
>>> Failed to emerge x11-base/xorg-server-1.11.1-r1, Log file:
>>> '/var/log/portage/x11-base:xorg-server-1.11.1-r1:20111024-184210.log'
I could certainly make a shell script that accepts $FILE and $GENTOO_MIRRORS but I want to understand why my solution is wrong.
My system
Code: Select all
portage 2.1.10.30
python 2.7.2-r3, 3.1.3-r1, 3.2.2 (default)
bash 4.2p10
kernel 3.1.0-rc8 (git-sources)



