“fuzz” in applying patches

patchquilt

I was applying a patch with quilt in Debian packaging that an error occurred:

Applying patch debian/patches/fixshare.patch
patching file net/slirp.c
Hunk #1 FAILED at 529.
1 out of 1 hunk FAILED -- rejects in file net/slirp.c

I googled it and I've understood that this error is because of "Fuzz" in applying patches. Now, my question is what's fuzz and how can I solve my problem in applying quilt patches?

I've read this article and did the steps that it told, but still I have problem!

Best Answer

This is not necessarily due to fuzz (in particular if you have refreshed the patches as told in the article). It may happen that the source has changed in such a way that patches are completely out of date. For instance, the original source was:

aa
bb
cc

and a patch told: replace line bb by dd (with some context, ignored here). Then the source changed to:

aa
bbb
cc

The patch still says: replace line bb by dd, but line bb no longer exists, so that the patch can no longer be applied successfully.

The solution is to look at the failed hunk, at the corresponding part of the old source (on which the patch could be applied), and try to see what has changed in the new source, then try to adapt the new source to regenerate the patch. This can only be done manually, and when there have been major changes in the source, this can be difficult, if not impossible.

Related Question