portage icon indicating copy to clipboard operation
portage copied to clipboard

eapply: Output verbosely only if patch fails to apply with -F0

Open mgorny opened this issue 5 years ago • 1 comments

12d0c48ad disabled silent output for eapply, in order to obtain fuzz factors in build logs. However, this also causes eapply to report all patched files which can make logs unreadable when there are no fuzz factors to be reported. Instead, use verbose output only when applying the patch with -F0 fails.

To achieve that, attempt to apply each patch with -F0 --dry-run first. If this succeeds, just silently apply the patch for real. If it doesn't, output an explicit eqawarn that the patch does not apply cleanly and retry with the default fuzz factor and verbose output. Non-silenced output applies both to successful application with fuzz and to failure.

Signed-off-by: Michał Górny [email protected]

mgorny avatar Nov 27 '19 18:11 mgorny

This fuzz 0 is a great idea. I only say that because I got bitten once on Archlinux by applying a patch with default fuzz(=2) and it was applied wrongly!

oh I found the note in my patch wrapper:

#XXX unconditionally use -F 0 aka no fuzz! because the default of 2 fuzz applied a cargo patch wrongly and yielded a compilation error! the code was in a different function!!

so the patch added a change in a completely different (Rust)function. I wish I had saved the patch and the .rs file or something, but apparently I didn't.

temporaryrespite avatar Feb 01 '20 15:02 temporaryrespite