Additional functionality of Portage

Updated 22 August 2019

etc-update

etc-update is a tool for updating system .cfg0000[HTML_REMOVED] files. It provides interactive setup and can also validate trivial changes automatically.
When you need to replace a file in a directory protected by CONFIG_PROTECT, Portage creates .cfg0000[HTML_REMOVED] files.

Dealing with etc-update is quite simple.

etc-update

After completing trivial updates, you will be prompted with a list of protected files waiting to be updated. You will have the choice between:

Please select a file to edit by entering the corresponding number.
              (-1 to exit) (-3 to auto merge all remaining files)
                           (-5 to auto-merge AND not use 'mv -i'):

When you press -1, etc-update exits, stopping subsequent changes. If you press -3 or -5, all listed configuration files will be replaced with newer versions. Therefore, it is important to first select files that should not be updated automatically. To do this, you only need to enter the number on the left of the file name.

For instance, let us look at /etc/pear.conf:

Beginning of differences between /etc/pear.conf and /etc/._cfg0000_pear.conf
...
End of differences between /etc/pear.conf and /etc/._cfg0000_pear.conf
1) Replace original with update
2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again

Now you can see the differences between the two files. If you are sure that the updated configuration file can be used with no problem, enter 1. If you think that the updated version of the configuration file is unnecessary or does not contain new or useful information, then enter 2. If you prefer interactive update, enter 3.

There is no point in describing the interactive update in detail. For completeness sake, we will list the possible commands that can be used while interactively merging the two files. You are greeted with two lines (the original one, and the proposed new one) and a prompt at which the user can enter one of the following commands:

ed:     Edit then use both versions, each decorated with a header.
eb:     Edit then use both versions.
el:     Edit then use the left version.
er:     Edit then use the right version.
e:      Edit a new version.
l:      Use the left version.
r:      Use the right version.
s:      Silently include common lines.
v:      Verbosely include common lines.
q:      Quit.

After having finished updating the important configuration files, you can then automatically update all the other configuration files. etc-update will exit if it doesn't find any more updateable configuration files.

dispatch-conf

With dispatch-conf you can update your configuration files while retaining the history of your updates. dispatch-conf stores the differences between configuration files as patches or as RCS versions.

As with etc-update, you can choose either to save the configuration file as is, to use the new configuration file, to edit the current one, or merge changes interactively. However, dispatch-conf has some nice bonus features:

  • auto update of files in which only comments were modified
  • auto update of files that differ only in the number of spaces

Make sure you edit /etc/dispatch-conf.conf beforehand and create the directory specified in archive-dir.

To learn more, refer to the dispatch-conf man page:

man dispatch-conf

quickpkg

With quickpkg you can create archives of already installed packages. They can be used as binaries. quickpkg has simple syntax: just specify the names of the packages you want to be archived.

For instance, to archive curl, arts and procps:

quickpkg curl arts procps

Binary packages will be stored in $PKGDIR/All (at /var/calculate/packages/x86_64 for 64 bit systems by default). The symlinks that point to these packages will be put in $PKGDIR/[HTML_REMOVED].