简体   繁体   中英

How to apply patch probably created with diff -r command?

Until now I created patches on Linux with this:

diff -rupN oldDir newDir > fix.patch

and applied them with this (from the oldDir):

patch -p1 < fix.patch

Now, I need to do a patch somebody else created and when I try this method, I get:

patch: **** Only garbage was found in the patch input.

I am not sure how this patch is generated (it has.diff extension). Partial content of patch file is: (just changed some file/folder names)

Only in ../oldDir: someFile1.a
diff -r ../oldDir/someFolder1/SomeFile3 ./someFolder1/SomeFile3
10c10
< #someContent1 
---
> #someContent1
Only in ../oldDir/someFolder1/someFolder2: someFile2.a
diff -r ../wfd_oldDir/someFolder1/someFolder2/someFile3 ./someFolder1/someFolder2/someFile3
2c2
< ##### Change the following for your environment: 
---
> ##### Change the following for your environment:
15,16c15,16
< LIBRARY_LINK =        ar cr 
< LIBRARY_LINK_OPTS =   
---
> LIBRARY_LINK =        ar cr
> LIBRARY_LINK_OPTS =
36c36
<   $(C_COMPILER) -c $(C_FLAGS) $<       
---
>   $(C_COMPILER) -c $(C_FLAGS) $<

....... (continue).......

How can I apply this patch?

Check for unix/windows line endings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM