PORTAGE_BINHOST="http://example.com" emerge -G package When the above is ran, http://example.com/Packages is redownloaded every time emerge is ran, even if it's the same exact file. Is it possible to have emerge save this to a specific location and check timestamps to see if it needs to be redownloaded? A workaround is possible by editing this file: /usr/lib/python3.4/site-packages/portage/dbapi/bintree.py
For http protocol, we already support the If-Modified-Since header: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e06cb6d66db37ac7ab77acf65038b1f770c13c96 For https protocol, If-Modified-Since support has been disabled since bug 469888: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b5969af9f575e4e4b669f44e76ad01f0dbc2dd27
Will date-checking work for https binhosts in the future? There's the following solution for having cache in https: https://p.sicp.me/bCETD.bash FETCHCOMMAND_HTTP="curlcache.sh \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
Correction: FETCHCOMMAND_HTTPS="curlcache.sh \"\${URI}\" \"\${DISTDIR}/\${FILE}\""
Since python 2.7.9/3.4.3, python libraries perform ssl certificate and hostname checks by default: https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection https://docs.python.org/3/library/http.client.html#http.client.HTTPSConnection This means that we can apply our existing If-Modified-Since support to https, as long as the python version is new enough.
I've got a patch here: https://github.com/zmedico/portage/tree/bug_625246
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/16a4da7f3eb2246a027e6b2c5c0a28da https://github.com/gentoo/portage/pull/183
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d821469d6b72ce051b02908f17302c500945788