简体   繁体   English

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

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

Until now I created patches on Linux with this:到目前为止,我在 Linux 上用这个创建了补丁:

diff -rupN oldDir newDir > fix.patch

and applied them with this (from the oldDir):并将它们与此一起应用(来自 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).我不确定这个补丁是如何生成的(它有.diff 扩展名)。 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检查 unix/windows 行结尾

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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