到目前为止,我在 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) $<
....... (继续) .......
我怎样才能应用这个补丁?