HOWTO etc-update

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

[edit] Introduction

etc-update is a tool to help merging changes made in config files during updates. You may also want to have a look at dispatch-conf, which also creates backups of your config files automatically.

[edit] Usage

  1. Run the command etc-update
  2. You'll see a list of changed config files. For each file, you can:
    1. Merge the update
    2. Discard the update
    3. Partially (interactively) merge the update
    4. Ignore the update

If you want to see the differences in the files, before you make a selection, just press [Enter]. Quit the diff mode you have entered by pressing "q".This will bring you back to the selection.

[edit] Merging changes interactively

Available 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.

[edit] Configuration

The configuration file of etc-update is /etc/etc-update.conf

[edit] Automerging changes

When eu_automerge is yes, changes in comments or CVS headers will be merged automatically.

eu_automerge=yes/no

[edit] Additional parameters

You can specify parameters passed to cp, mv and rm. Example:

rm_opts="-i"
mv_opts="-i"
cp_opts="-i"

[edit] Diff command

You can choose command used to print differrences between files. Filenames are passed as %file1 and %file2. Example for diff:

diff_command="diff -uN %file1 %file2"
using_editor=0

Example for vimdiff:

diff_command="vim -d %file1 %file2"
using_editor=1

[edit] Merge command

You probably don't want to change it. It specifies command used to actually merge the changes. Default is

sdiff -s -o %merged %orig %new

Passed parameters are %orig, %new and %merged.

[edit] Colored output

When you would like to have some color ouput to your etc-update I suggest you use colordiff. It's a small program that gives something extra to your diff needs. It's very easy to install and to set up:

# emerge colordiff
File: /etc/etc-update.conf
diff_command="colordiff -uN %file1 %file2"

You may also need to change less to accept raw input if you are using it as your pager.

File: /etc/etc-update.conf
pager="less -r"

[edit] General tips on how to use etc-update

If you use etc-update for the first time, you'll probably don't know which config files you should overwrite or keep. In general, you should follow these simple rules:

  • Always overwrite files in /etc/init.d/ with their new version. This ensures every daemon will start up correctly.
  • In almost all cases, it is advisable to overwrite any config file you never edited by yourself. Most users won't change anything in /etc/udev/ or /etc/pam.d/ or many other config files which don't need any changes (except on very "special" systems).
  • Look at every file you changed manually. In most cases, etc-update wants to replace them with their original copy. This is surely not what you want, and in 99% of all cases you'll want to keep your own config.
  • If you're unsure about what to do with a specific configuration file, look at the changes. If this doesn't help, ask a friend or in the Gentoo forums, and ignore the update for this time.

[edit] Discussion

Concerns or Compliments? Please use the Discussion section.

[edit] Related Articles

  • TIP dispatch-conf - A more functional alternative with support for (incremental) backups.
Personal tools
In other languages