OpenWrt Forum Archive

Topic: Error on diff and patch

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I modified a patch file according a new diff , and did make my project, always errors as below:

Applying patch platform/740-MIPS-ath79-lp-wr934x-fixes.patch~
patching file arch/mips/ath79/Kconfig
Hunk #1 succeeded at 143 with fuzz 2 (offset 15 lines).
The next patch would create the file arch/mips/ath79/mach-lp-wr934x.c,
which already exists!  Applying it anyway.
patching file arch/mips/ath79/mach-lp-wr934x.c
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- rejects in file arch/mips/ath79/mach-lp-wr934x.c
patching file arch/mips/ath79/machtypes.h
Hunk #1 FAILED at 31.
1 out of 1 hunk FAILED -- rejects in file arch/mips/ath79/machtypes.h
patching file arch/mips/ath79/Makefile
Hunk #1 FAILED at 51.
1 out of 1 hunk FAILED -- rejects in file arch/mips/ath79/Makefile
Patch platform/740-MIPS-ath79-lp-wr934x-fixes.patch~ does not apply (enforce with -f)

Why my patch was rejected ?-- "rejects in file arch/mips/ath79/mach-lp-wr934x.c"

Solved.

The patch name is "740-MIPS-ath79-lp-wr934x-fixes.patch".
When I modified in "gedit" and saved it, not only "740-MIPS-ath79-lp-wr934x-fixes.patch" saved, but a new "740-MIPS-ath79-lp-wr934x-fixes.patch~"(a hide file) saved as well in that patch DIR. Next, this "*.patch~" file was also used to patch in compiling.

So strange errors occured.
Should deleted that file at first.

The discussion might have continued from here.