Document Actions

Using kdiff3 for etc-update

by David Hostetler [posted 20110201:16:13 (Tue)]

This is the first part of a 3-part series (of configuration trivia), wherein I describe how to use kdiff3 in a situation where you need to automatically invoke a graphical diff tool.

This part deals with gentoo's etc-update tool, which is used to reconcile changes made by portage to various configuration files (typically located in /etc, hence the name).

etc-update defers to /etc/etc-update.conf for some of its behavioral configuration, including the manner in which it invokes a diff tool.

So to use kdiff3, just edit /etc/etc-update.conf to include the following:

 

pager=""
using_editor=1
diff_command="sudo kdiff3 %file1 %file2"
merge_command="sudo kdiff3 --merge --output %merged %orig %new"

Be sure to also comment out (with a leading '#') any existing line that has one of the keywords listed in the above assignments.

And that's it!

Note that the 'sudo' part is necessary because kdiff3 is subject to some kind of KDE policy that protects against root use of GUI apps.  Or something... I never quite found a straight answer, but I know it won't launch if you're root without using sudo.