kliketa
kliketa

Reputation: 1266

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?

Upvotes: 4

Views: 5276

Answers (1)

Edson Medina
Edson Medina

Reputation: 10269

Check for unix/windows line endings

Upvotes: 3

Related Questions