Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 20233

Summary: Extend portage-2.0.47-r10 to understand ". file" syntax in configuration files
Product: Gentoo Linux Reporter: Dave Love <dlove>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: RESOLVED WORKSFORME    
Severity: enhancement Keywords: Inclusion
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch which adds '. file' support to portage.py

Description Dave Love 2003-04-30 15:19:16 UTC
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.
Comment 1 SpanKY gentoo-dev 2003-04-30 16:03:47 UTC
*** Bug 20232 has been marked as a duplicate of this bug. ***
Comment 2 Dave Love 2003-04-30 17:20:49 UTC
Created attachment 11334 [details, diff]
Patch which adds '. file' support to portage.py
Comment 3 Marius Mauch (RETIRED) gentoo-dev 2004-02-09 01:45:17 UTC
I'd rather use "source filename" instead of ". filename" for readability (patch still applies to 2.0.50, very rare these days).
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2004-04-13 18:16:23 UTC
Not a bad idea, but no longer relevant.
Portage doesn't overwrite that config any longer.