svn commit: r533459 - head/Mk/Scripts
Conrad Meyer
cem at freebsd.org
Mon May 4 18:01:40 UTC 2020
Hi Bryan,
On Mon, May 4, 2020 at 10:49 AM Bryan Drewery <bdrewery at freebsd.org> wrote:
>
> On 4/30/2020 7:48 AM, Mathieu Arnold wrote:
> > Author: mat
> > Date: Thu Apr 30 14:48:22 2020
> > New Revision: 533459
> > URL: https://svnweb.freebsd.org/changeset/ports/533459
> >
> > Log:
> > When one patch fails, continue with appling patches.
> >
> > This makes the process of make patch, fix fallout, make makepatch much
> > easier as only one iteration is required.
> >
> > While there, refactor things around, and streamline messages passed
> > between functions.
> >
> > PR: 244626
> > Reported by: cem
> >
>
> Will this fail between stages? If a files/patch-* patch fails it should
> not move on to extra patches as then makepatch / diffing will be wrong.
> Even patch-* can lead to being wrong when considering local (not in
> ports tree) patches.
>
> I don't think this is good default behavior.
The version of this I submitted aborted at the end of
patch_from_directory() if any patches failed for that invocation. It
didn't do this 'has_failed' mechanism. So it would've stopped between
various stages, I think.
I think ports' crazy patching behavior is complicated enough without
worrying about random out-of-tree non-conformant patches.
I don't know about default behavior or not. I found this essential
when updating Chromium (700+ patches, majority conflicting) across
major versions; one patch at a time would've been impossible. Not
every port is chromium, though.
Best,
Conrad
> > --- head/Mk/Scripts/do-patch.sh Thu Apr 30 14:47:59 2020 (r533458)
> > +++ head/Mk/Scripts/do-patch.sh Thu Apr 30 14:48:22 2020 (r533459)
> > ...
> > @@ -73,24 +83,29 @@ patch_from_directory() {
> > for i in patch-*; do
> > case ${i} in
> > *.orig|*.rej|*~|*,v)
> > - ${dp_ECHO_MSG} "===> Ignoring patchfile ${i}"
> > + ${dp_ECHO_MSG} "====> IGNORING patchfile ${i}"
> > ;;
> > *)
> > if [ -n "${dp_PATCH_DEBUG_TMP}" ]; then
> > - ${dp_ECHO_MSG} "===> Applying ${msg} patch ${i}"
> > + ${dp_ECHO_MSG} "====> Applying ${msg} patch ${i}"
> > fi
> > - if do_patch ${dp_PATCH_ARGS} < ${i}; then
> > + if cat_file "$i" | do_patch ${dp_PATCH_ARGS}; then
> > patches_applied="${patches_applied} ${i}"
> > else
> > - ${dp_ECHO_MSG} "=> ${msg} patch ${i} failed to apply cleanly."
> > - if [ -n "${patches_applied}" -a "${dp_PATCH_SILENT}" != "yes" ]; then
> > - ${dp_ECHO_MSG} "=> Patch(es) ${patches_applied} applied cleanly."
> > - fi
> > - false
> > + ${dp_ECHO_MSG} "====> FAILED Applying ${msg} patch ${i}"
> > + patches_failed="${patches_failed} ${i}"
> > fi
> > ;;
> > esac
> > done
> > +
> > + if [ -n "${patches_applied}" -a "${dp_PATCH_SILENT}" != "yes" ]; then
> > + ${dp_ECHO_MSG} "===> Cleanly applied ${msg} patch(es) ${patches_applied}"
> > + fi
> > + if [ -n "${patches_failed}" -a "${dp_PATCH_SILENT}" != "yes" ]; then
> > + ${dp_ECHO_MSG} "===> FAILED to apply cleanly ${msg} patch(es) ${patches_failed}"
> > + has_failed=1
Mine aborted here ^^^.
> > + fi
> > fi
> > fi
> > }
More information about the svn-ports-head
mailing list