This is a request for a small feature in the new portage. It would be helpful if the FETCHCOMAND in make.conf could be sensitive to the transfer protocol of the mirror in use. This is particularly needed for those of us who try to minimise the load on gentoo mirrors by using a local rsync server. At present an rsync FETCHCOMMAND will not work with external mirrors. What is needed is to be able to have a mirror list in make.conf such as: GENTOO_MIRRORS="rsync://192.168.1.4/gentoo-distfiles ftp://cs.ubishops.ca/pub/gentoo ... " And several protocol-sensitive FETCHCOMMANDS such as FETCHCOMMAND=(ftp:, http:) "/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" FETCHCOMMAND=(rsync:) "rsync \${URI} \${DISTDIR}" which are selected by the protocol prefix on the mirror URL (i.e. ftp:, rsync:) This would allow a package to be fetched locally if available, from the external mirror system otherwise. Reproducible: Always Steps to Reproduce: 1. 2. 3.
This syntax wouldn't work, if implemented it would be new variables like FTP_FETCHCOMMAND which would use FETCHCOMMAND as default.
I'm not in any way attached to my proposed syntax, which was devised purely by way of example and without proper study of how portage works. The syntax Marius Mauch proposes will do the job just as well, and if it's easier to implement it is clearly better.
Created attachment 24978 [details, diff] patch to use FETCHCOMMAND_HTTP, FETCHCOMMAND_FTP, ...
Thanks, that looks really good. I'm snowed under with work just now, but I'll do serious testing next week.
Bug has been fixed and released in stable portages on or before 2.0.51-r2