Reading and applying patches

Andy Green andy at warmcat.com
Tue Sep 5 05:29:11 UTC 2006


Ed Greshko wrote:

>> --- mlrate/mlrate.c 2003-01-27 10:31:31.000000000 +0100 
>> I assume that I should copy and paste the text into a separate file and
>> save it. But how do I apply the patch to the source file, which is
>> mlrate.c? 

Yes, be careful of linewrap if it did not come as an attachment. 
Because the patch file mentions m1rate.c, you don't have to specify that 
anywhere else.

> Normally, it you simply do "patch -p0 < patchfilename"

That's right, just to explain the -p option says how many levels of 
directory to chop off the left hand side of filepaths talked about in 
the patch file.  Sometimes patches come with more or less of the project 
path from the originator, and depending on what your current working 
directory is when you apply the patch, you can need to mess with it. -p0 
is the case where you are in the same relative directory as the guy was 
when he made the patch.  -p1 is for if you are one level down in your 
tree and need to lose the first part of his paths, and so on.

-Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4492 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060905/916718d1/attachment-0001.bin>


More information about the fedora-list mailing list