views:

49

answers:

2

I have a kernel patch for a slightly different kernel version then the one I'm trying to patch. Needless to say, the patch partially fails. I can certainly fix it manually, but I was wondering maybe there is a graphical patch utility that can be used to resolve the conflicts.

A: 

I don't know about a graphical patch utility, but what I would probably do is obtain the file(s) in the old kernel version, apply the patch to obtain patched old file(s) (keeping the old file(s)), obtain the file(s) in the new kernel version, and then use a 3-way merge tool such as GNU Meld.

This procedure is a little time consuming, but I have found it extremely helpful in resolving Subversion conflicts (very similar to what you are trying to accomplish). And, it allows you to quickly ascertain how different the file(s) in the two kernel versions are, what has changed, and various changes that you will likely need to make to the patch lines in order to make them compatible with the new file(s).

Daniel Trebbien
I know about meld. The obvious problem with what you suggested is that there are too many difference, in addition to the patch, between the old and the new kernel versions.It appears that the utility I'm looking for does not exist, so I will have to do it manually. Thanks anyway.
Demiurg
A: 

There are many graphical patching utilities, try meld, diffuse, kdiff3 or dirdiff, they should be packaged for your distribution.

Another useful tool is wiggle, which "tries harder" to resolve conflicts, and will turn a rej file from patch into a CVS-style inline conflict with >>> markers.

I tend to use it with an underlying revision system, so I'm happy to revert its changes if they're wrong, as such I use:

wiggle -v --replace <file> <file.rej>

Which says to do the transformation in place, sometimes it will just do the right thing, other times you end up with >>> markers and can edit by hand, but it's easier than using a rej file by hand. If it really does a bad job I use my revision control system (git) to revert back to the original.

mpe