How to apply patches?

Bruce Stephens bruce.stephens@messagingdirect.com
Tue Aug 1 04:34:00 GMT 2000


"Thomas Heller" <thomas.heller@ion-tof.com> 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
2.5.4.

The problem is in determining the filename:

[...]

>   --------------------------
>   |Index: snavigator/gui/Makefile.am
>   |===================================================================
>   |RCS file: /cvs/cvsfiles/devo/snavigator/gui/Makefile.am,v
>   |retrieving revision 1.27.2.2.2.3.4.4
>   |diff -c -2 -p -r1.27.2.2.2.3.4.4 Makefile.am
>   |*** Makefile.am        2000/02/11 23:48:34     1.27.2.2.2.3.4.4
>   |--- Makefile.am        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,
Makefile.am (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			Bruce.Stephens@MessagingDirect.com
MessagingDirect(UK) Ltd		<URL: http://www.MessagingDirect.com/ >



More information about the Sourcenav mailing list