This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Handbuch:X86/Portage/Tools

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:X86/Portage/Tools and the translation is 100% complete.
X86 Handbook
Installation
About the installation
Choosing the media
Configuring the network
Preparing the disks
Installing stage3
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Finalizing
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Variables
Mixing software branches
Additional tools
Custom package repository
Advanced features
Network configuration
Getting started
Advanced configuration
Modular networking
Wireless
Adding functionality
Dynamic management


dispatch-conf

dispatch-conf is a tool that aids in merging the ._cfg0000_<name> files. ._cfg0000_<name> files are generated by Portage when it wants to overwrite a file in a directory protected by the CONFIG_PROTECT variable.

With dispatch-conf, users are able to merge updates to their configuration files while keeping track of all changes. dispatch-conf stores the differences between the configuration files as patches or by using the RCS revision system. This means that if someone makes a mistake when updating a config file, the administrator can revert the file to the previous version at any time.

When using dispatch-conf, users can ask to keep the configuration file as-is, use the new configuration file, edit the current one or merge the changes interactively. dispatch-conf also has some nice additional features:

  • Automatically merge configuration file updates that only contain updates to comments.
  • Automatically merge configuration files which only differ in the amount of whitespace.

Edit /etc/dispatch-conf.conf first and create the directory referenced by the archive-dir variable. Then, execute dispatch-conf:

root #dispatch-conf

When running dispatch-conf, each changed config file will be reviewed one at a time. Press u to update (replace) the current config file with the new one and continue to the next file. Press z to zap (delete) the new config file and continue to the next file. The n key will instruct dispatch-conf to skip to the next file. This can be done to delay a merge until a future time. Once all config files have been taken care of, dispatch-conf will exit. At any time, q can be used to exit the application as well.

Für weitere Informationen schauen Sie sich die dispatch-conf Man-Page an. Sie beschreibt wie man aktuelle und neue Konfigurationsdateien interaktiv zusammenführt, neue Konfigurationsdateien bearbeitet, Unterschiede zwischen Dateien untersucht und weiteres.

user $man dispatch-conf

etc-update

Another tool to merge configuration files is etc-update. It is not as simple to use as dispatch-conf, nor as fully featured, but it does provide an interactive merging setup and can also auto-merge trivial changes.

However, unlike dispatch-conf, etc-update does not preserve the old versions of the config files. Once a file is updated, the old version is gone forever. Be very careful, as using etc-update is significantly less safe than using dispatch-conf when desiring to keep old configuration files.

root #etc-update

Nach der Vereinigung der unkomplizierten Änderungen, bekommt man eine Liste der geschützten Dateien, die noch auf eine Aktualisierung warten. Unten werden die möglichen Optionen gezeigt:

CODE Die von etc-update angebotenen Optionen
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 entering -1, etc-update will exit and discontinue any other changes. With -3 or -5, all listed configuration files will be overwritten with the newer versions. It is therefore very important to first select the configuration files that should not be automatically updated. This is simply a matter of entering the number listed to the left of that configuration file.

Als Beispiel wählen wir die Konfigurationsdatei /etc/pear.conf:

CODE Eine bestimmte Konfigurationsdatei aktualisieren
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

The differences between the two files are shown. If the updated configuration file can be used without problems, enter 1. If the updated configuration file isn't necessary, or doesn't provide any new or useful information, enter 2. If the current configuration file has to be interactively updated, enter 3.

Es hat keinen Zweck das interaktive Verschmelzen hier weiter auszuführen. Der Vollständigkeit halber führen wir die möglichen Befehle auf, die bei der interaktiven Zusammenführung verwendet werden können. Die Benutzer werden von zwei Zeilen (der originalen und der vorgeschlagenen neuen) und einem Prompt empfangen, an dem der Benutzer einen der folgenden Befehle eingeben kann:

CODE Für die interaktive Zusammenführung zur Verfügung stehende Befehle
ed:     Bearbeiten und dann beide Versionen mit einer Kopfzeile gekennzeichnet benutzen.
        (edit decorated)
eb:     Bearbeiten und dann beide Versionen benutzen.
        (edit, use both)
el:     Bearbeiten und dann die linke Version benutzen.
        (edit, use left)
er:     Bearbeiten und den die rechte Version benutzen.
        (edit, use right)
e:      Eine neue Version bearbeiten.
        (edit)
l:      Benutze die linke Version.
        (left)
r:      Benutze die rechte Version.
        (right)
s:      Stillschweigend gewöhnliche Zeilen einbeziehen.
        (silent)
v:      Wortreich gewöhnliche Zeilen einbeziehen.
        (verbose)
q:      Beenden
        (quit)

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

quickpkg

With quickpkg users can create archives of the packages that are already merged on the system. These archives can be used as prebuilt packages. Running quickpkg is straightforward: just add the names of the packages to archive.

Zur Archivierung von z.B. curl, orage und procps:

root #quickpkg curl orage procps

Die vorgefertigten Pakete werden in $PKGDIR gespeichert (standardmässig in /usr/portage/packages/). Diese Pakete werden in $PKGDIR/CATEGORY untergebracht.