I maintain a local distfile mirror, which is listed first in make.confs GENTOO_MIRRORS. My mirror is not always up to date, and doesnt contain every package, so my GENTOO_MIRRORS also lists ibiblio. Some of my gentoo machines are firewalled such that they can not access ibiblio directly. They need to use a proxy, which I can set in http_proxy. Access control rules on this proxy means that it can not access internal hosts, including the mirror. I would be nice to be able to configure portage so that it accesses the local mirror directly, and ibiblio via the proxy. Browsers have host exclude lists in their proxy configurations to support this network topology - it would be nice if portage had an equivalent.
Attached is a first draft patch to implement this, for portage 2.0.47-r8 This patch adds support for a new make.conf setting, DIRECT_MIRRORS. This is a list of host names that should not be accessed via a proxy. Bypassing a proxy is handled with a change to FETCHCOMMAND (and RESUMECOMMAND). This is best illustrated with example... my FETCHCOMMAND line using wget now looks like: FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR} \${DIRECT --proxy=off}" The ${DIRECT} section is either included or removed, depending whether it is fetching from a mirror whose host name is listed in DIRECT_MIRRORS This currently works for me. Some things I'm not sure about: 1. should DIRECT_MIRRORS contain the host name (as now) or the full mirror URI? 2. will this be general enough for downloaders other than wget?
Created attachment 10139 [details, diff] patch to portage-2.0.47-r8 to specify that some mirrors should be accessed directly, not via a proxy.
Ive just been through another round of updates where having this in standard portage would have been useful. I cant be the only one that would benefit from this...... This one looks like a low-risk low-effort enhancement, so Im suprised this hasnt attracted any attention over the last 6 months. Is there anyone I can nudge?
My choice would be to export no_proxy in the same place where you probably export http_proxy. At least for wget this does the job.
> At least for wget this does the job. Thats a good tip. Many thanks.