On 17 Feb 2003, "Boyce, Nick" <[EMAIL PROTECTED]> wrote: > Here's what I get if I apply the posted patch :
As I said I'll send you an update just for 2.2. But in general, in case you're interested, here are some tips on applying mismatched patches: > MYBOX:/usr/local/src/samba-2.2.7a/source/lib# patch util_sock.c > patch-util_sock.txt.orig > patching file util_sock.c > Hunk #1 succeeded at 1018 with fuzz 2 (offset 133 lines). > Hunk #2 FAILED at 1037. > Hunk #3 FAILED at 1094. > 2 out of 3 hunks FAILED -- saving rejects to file util_sock.c.rej In general the best thing to do now is leave the main diff alone, and only work on the rejected parts in the .rej file. Basically you need to work out why patch thinks the 2.2 source file doesn't look like the "before" version of the rejected patch. > After deleting the line containing "#ifdef HAVE_UNIXSOCKET" (because I > noticed it doesn't appear in my 2.2.7a version of util_sock.c), I get a > little further : > MYBOX:/usr/local/src/samba-2.2.7a/source/lib# patch util_sock.c > patch-util_sock.txt > patching file util_sock.c > Hunk #1 succeeded at 1018 with fuzz 2 (offset 133 lines). > patch: **** malformed patch at line 102: @@ -966,25 +961,26 @@ Do you mean you deleted that line from the patch? That's probably what is causing the "malformed patch" error: the line numbers in the patch no longer add up. However, if you install the "patchutils" package, then you can run "recountdiff" to fix the lines up after you edit a diff, and it should then apply. patchutils is very very cool. -- Martin