How to apply patches?

Bruce Stephens
Tue Aug 1 04:34:00 GMT 2000

"Thomas Heller" <> writes:

> (Although I have created several patches in the past, I've
> never applied any myself)

I've created and applied patches without difficulty in the past.
However, these patches look impossible to apply using GNU patch 2.5 or

The problem is in determining the filename:


>   --------------------------
>   |Index: snavigator/gui/
>   |===================================================================
>   |RCS file: /cvs/cvsfiles/devo/snavigator/gui/,v
>   |retrieving revision
>   |diff -c -2 -p -r1.
>   |***        2000/02/11 23:48:34
>   |---        2000/07/25 19:19:57
>   --------------------------

There are three relevant pathnames here: the old path, the new path,
and the Index: path.  According to the manpage, patch will consider
them in that order.  

If in POSIX mode, it'll take the first one that exists (in this case, (the old pathname).  Otherwise, it'll choose the best
pathname.  Unfortunately, the best pathname seems to be the name with
fewest path name components, with the shortest basename.

Presumably somewhere there's a patch where you can tell it to use
Index, ignoring other pathnames.  Indeed, that would seem to me to be
sane behaviour---if there's an Index line present, then surely whoever
generated the patch knew what they were doing.  

Anyway, I don't know how to apply these patches.  Do RedHat have some
special version of patch?

Bruce Stephens
MessagingDirect(UK) Ltd		<URL: >

More information about the Sourcenav mailing list