OK, until recently I was very, very slack at keeping my /etc files up todate - mainly because I didn't know about

Code:

etc-update

I started using etc-update, but found the console diffs hard to follow. A bit of scrounging around found the file

Code:

/etc/etc-update.conf

If you take a look at it you'll find there are some provisions for changing the commands for diff and merge, there are event lines you can uncomment to enable vim diffing.

I'm not all that great with vim, so I thought I'd try to use a graphical diff - namely gtkdiff.
You'll need to emerge it

Code:

emerge gtkdiff

I think xxdiff would probably do, but I haven't had more than a cursory look - so I won't comment.

The first change is the line

Code:

pager="less"

it needs to go to

Code:

#pager="less"
pager=""

Then you need to change the diff_command, mine looks like

Code:

diff_command="gtkdiff -g 1600x1000 %file1 %file2"

I like to use my whole resolution for width, so I specify the geometry with

Code:

-g 1600x1000

Change these values so gtkdiff looks nice on the screen.

For the merge command I have

Code:

merge_command="gtkdiff -g 1600x1000 -o %merged %orig %new"

The merge command displays 3 panes, with the merged pane displayed in the top half - the program is simple to control so I won't go over it. The only gotcha is that after you are happy with the merge, you must save the merged file - simply right-click on the top pane and select output file.

This works fine for me - my only problem is that gtkdiff will display 3 panes after it has been used in merge mode, even when it is in diff mode. If anybody knows how to force 2 panes only in diff mode (via commandline, not via the GUI) please let me know.

If I get motivated enough I may trawl through the code & add options to force 2 pane and auto-save.

Oh, if you're like me & su to root from a console, you will probably need to run

Code:

xhost +

with your regular user. There are security issues here I'd expect, but I don't know about them - help here would be good.

Any feedback would be great.

Cheers
Brad

Last edited by BradB on Tue Jan 07, 2003 7:52 pm; edited 1 time in total

BradB:i like your idea a lot so i followed your instructions.when i run etc-update i get the output in no-gui.when i run gtkdiff i get nothing.how do i run this?_________________Hey.I am new to Linux and i will ask some stupid questions sometimes so please don't get angry with me and help

Hey, is there a good package to install/reinstall to test out the new merging?

I don't want anything big or important.

This is a GREAT idea. And I'm really glad you published it. I happen to be deeply in love with vim, so I will go that way, but that doesn't detract from my thank you in anyway._________________There are thousands of types of people in this world:
The type that seperates people into two groups,
and the thousands of other types.

a program called kompare was just pointed out to me. it lets you interactively (&graphically) merge the two files. now someone needs to figure out how to use it with etc-update. kompare is in kde-base/kdesdk

This is a GREAT idea... THANKS! The terminal etc-update has been my least favorite thing about Gentoo so far (though I like the concept of protecting them it's been a bit of a pain for some). Now I have nothing to complain about... just need to find something to test it out on. Suggestions anyone for a package to test it on?

Thanks, Kevin_________________There are two kinds of people in this world: those who believe there are two kinds of people and those who know better.

You could check the output from `tty` and go from there. I use it in my
.bash_profile to find out if I'm on the first virtual console to automagically
fire up X for me. Just need to take this example one step further...