如何应用可能使用diff -r命令创建的补丁?

时间:2012-08-10 08:52:56

标签: linux diff patch

到目前为止,我在Linux上创建了补丁:

diff -rupN oldDir newDir > fix.patch

并将其应用于此(来自oldDir):

patch -p1 < fix.patch

现在,我需要做别人创建的紧急补丁,当我尝试这种方法时,我得到:

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

我不确定这个补丁是如何生成的(扩展名为.diff)。补丁文件的部分内容是:(只更改了一些文件/文件夹名称)

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) $<

.......(继续).......

有人可以告诉我如何应用此补丁吗?我google了一点但没有帮助。我也会问那个制作补丁的人,但这需要几天时间。

1 个答案:

答案 0 :(得分:2)

检查unix / windows行结尾