Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 May 2020 11:01:26 -0700
From:      Conrad Meyer <cem@freebsd.org>
To:        Bryan Drewery <bdrewery@freebsd.org>
Cc:        Mathieu Arnold <mat@freebsd.org>, ports-committers@freebsd.org,  svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r533459 - head/Mk/Scripts
Message-ID:  <CAG6CVpVL46PKBLru_TzO-N%2BCZkGSs=d1H6qiSLRmf%2B6xUnHLng@mail.gmail.com>
In-Reply-To: <276aef88-4619-b4b7-ee92-44999b5c787d@FreeBSD.org>
References:  <202004301448.03UEmMwc053196@repo.freebsd.org> <276aef88-4619-b4b7-ee92-44999b5c787d@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Bryan,

On Mon, May 4, 2020 at 10:49 AM Bryan Drewery <bdrewery@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
> >  }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpVL46PKBLru_TzO-N%2BCZkGSs=d1H6qiSLRmf%2B6xUnHLng>