savedconfig.eclass - common API for saving/restoring complex configuration files
It is not uncommon to come across a package which has a very fine
grained level of configuration options that go way beyond what
USE flags can properly describe. For this purpose, a common API
of saving and restoring the configuration files was developed
so users can modify these config files and the ebuild will take it
into account as needed.
Typically you can create your own configuration files quickly by
Build the package with FEATURES=noclean USE=savedconfig.
Go into the build dir and edit the relevant configuration system
(e.g. `make menuconfig` or `nano config-header.h`). You can look
at the files in /etc/portage/savedconfig/ to see what files get
Copy the modified configuration files out of the workdir and to
the paths in /etc/portage/savedconfig/.
Emerge the package with just USE=savedconfig to get the custom build.
save_config <config files to save>
Use this function to save the package's configuration file into the
right location. You may specify any number of configuration files,
but just make sure you call save_config with all of them at the same
time in order for things to work properly.
restore_config <config files to restore>
Restores the package's configuration file probably with user edits.
You can restore a single file or a whole bunch, just make sure you call
restore_config with all of the files to restore at the same time.