This is a very short patch (it adds 5 lines) to portage.py that adds support for sourcing files (". file") from within configuration files. Reason: Merging configuration files after a portage update has proved to be both painful and fraught with error (I've lost my USE settings before by screwing up the merge). This patch allowed me to move the settings I want to override to their own file, and simply include that file in portage's file. For example, I've copied the settings I want to override in /etc/make.conf -- USE, CFLAGS, etc. -- to /etc/my.make.conf. The only change I need to make to an updated /etc/make.conf is to add the single line ". /etc/my.make.conf" to the end of it. Merges are now trivial and my settings are always safe. The only point of caution here is that variables are expanded immediately upon reference. This implies that given CXXFLAGS="${CFLAGS}" in make.conf, then if CFLAGS is subsequently redefined in my.make.conf, CXXFLAGS also needs to be redefined in my.make.conf. In practice, this hasn't been a problem. Reproducible: Always Steps to Reproduce: 1. 2. 3.
*** Bug 20232 has been marked as a duplicate of this bug. ***
Created attachment 11334 [details, diff] Patch which adds '. file' support to portage.py
I'd rather use "source filename" instead of ". filename" for readability (patch still applies to 2.0.50, very rare these days).
Not a bad idea, but no longer relevant. Portage doesn't overwrite that config any longer.