was about to push upstream, David did you want to do a V3 first that allows
for candidates >2?
Right now, it only handles 1 or 2 candidates.

-b

On Wed, Feb 15, 2017 at 9:03 AM, Joshua Lock <[email protected]>
wrote:

> On Wed, 2017-02-15 at 06:04 +0000, Reyna, David wrote:
> > From da520beb19ee6a49178ae1181d12d088017acaf1 Mon Sep 17 00:00:00
> > 2001
> > From: David Reyna <[email protected]>
> > Date: Tue, 14 Feb 2017 20:56:30 -0800
> > Subject: [PATCH] toaster: resolve missing 'native[sdk]:' prefixes
> >
> > Some task events are missing the 'virtual:native[sdk]:' prefixes.
> > The Toaster has code to help match missing prefixes, but needs
> > additional help resolving between 'native:' and 'nativesdk:', by
> > way of the '_package' event field.
> >
> > [YOCTO #10849]
>
> This v2 looks much neater, thanks!
>
> >
> > Signed-off-by: David Reyna <[email protected]>
> > ---
> >  bitbake/lib/bb/ui/buildinfohelper.py | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> > b/bitbake/lib/bb/ui/buildinfohelper.py
> > index 5ed150d..dee40c4 100644
> > --- a/bitbake/lib/bb/ui/buildinfohelper.py
> > +++ b/bitbake/lib/bb/ui/buildinfohelper.py
> > @@ -1258,6 +1258,15 @@ class BuildInfoHelper(object):
> >                  candidates = [x for x in
> > self.internal_state['taskdata'].keys() if x.endswith(identifier)]
> >                  if len(candidates) == 1:
> >                      identifier = candidates[0]
> > +                # break tie if missing 'native[sdk]:' prefix
> > +                if (len(candidates) == 2) and
> > hasattr(event,'_package'):
>
> Out of interest, can we have more than 2 candidates here? Should we
> just have something like:
>
> if len(candidates) == 1:
>   # pick that identifier
> elif len(candidates) > 1 and hasattr(event, '_package'):
>   # break the tie
>
> Thanks,
>
> Joshua
>
> > +                    if 'native-' in event._package:
> > +                        identifier = 'native:' + identifier
> > +                    if 'nativesdk-' in event._package:
> > +                        identifier = 'nativesdk:' + identifier
> > +                    candidates = [x for x in
> > self.internal_state['taskdata'].keys() if x.endswith(identifier)]
> > +                    if len(candidates) == 1:
> > +                        identifier = candidates[0]
> >
> >          assert identifier in self.internal_state['taskdata']
> >          identifierlist = identifier.split(":")
> > --
> > 1.9.1
> --
> _______________________________________________
> toaster mailing list
> [email protected]
> https://lists.yoctoproject.org/listinfo/toaster
>
-- 
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Reply via email to