Gentoo Wiki ArchivesGentoo Wiki

HOWTO_etc-update

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

Contents

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.

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.

Merging changes interactively

Available commands:

Configuration

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

Automerging changes

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

eu_automerge=yes/no

Additional parameters

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

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

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

Merge command

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

merge_command="sdiff -s -o %merged %orig %new"

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

There is a note in the configuration file saying that vimdiff cannot be used to merge, but that is not right. The following makes a vimdiff with the left buffer as the merged file, which starts out as the original, and the right buffer as the new file. Simply save and quit, then you can choose either file as the one to use. Change the script filename as you see fit.

merge_command="vimdiff %merged %orig %new -S /usr/local/bin/etc-update.vim"

/usr/local/bin/etc-update.vim

wincmd l
normal ggVGy
quit
wincmd h
normal pggdd
diffupdate

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"

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:

Discussion

Concerns or Compliments? Please use the Discussion section.

Related Articles

Retrieved from "http://www.gentoo-wiki.info/HOWTO_etc-update"

Last modified: Mon, 21 Jul 2008 18:52:00 +1000 Hits: 45,530

Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.