On Tue, 2022-03-15 at 17:48 +0000, Peter Kjellerstedt wrote: > > -----Original Message----- > > From: [email protected] > > <[email protected]> On Behalf Of Richard Purdie > > Sent: den 15 mars 2022 18:33 > > To: [email protected] > > Subject: [OE-core] [PATCH 1/2] create-spdx: Use function rather than > > AVAILABLE_LICENSES > > > > We can directly call the function rather than using the variable > > indirection. > > As this is the last user of the variable, it then allows removal of it in a > > followup patch. > > > > Signed-off-by: Richard Purdie <[email protected]> > > --- > > meta/classes/create-spdx.bbclass | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create- > > spdx.bbclass > > index daf99ca676c..1a4804a7c50 100644 > > --- a/meta/classes/create-spdx.bbclass > > +++ b/meta/classes/create-spdx.bbclass > > @@ -94,7 +94,7 @@ def convert_license_to_spdx(lic, document, d, > > existing={}): > > from pathlib import Path > > import oe.spdx > > > > - available_licenses = d.getVar("AVAILABLE_LICENSES").split() > > + avail_licenses = available_licenses(d) > > Doesn't this mean that the available licenses will be calculated once > per recipe? Or isn't it a problem since the time will not be spent > during recipe parsing, but rather during task execution where no one > will notice if the create-spdx task for all recipes takes a little > longer?
It will be in a different process so it will already run once per recipe during task execution anyway. So yes, this just allows us to move execution overhead away from parsing. > That said, if I remember correctly from the last time I looked at this > function, it should be possible to rewrite it to not rely on > available_licenses() without any real loss in functionality. Patches very welcome. Now we're moving to SPDX identifiers only, this need to this is likely reduced too. I needed to start unwinding the pieces somewhere though... Cheers, Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#163315): https://lists.openembedded.org/g/openembedded-core/message/163315 Mute This Topic: https://lists.openembedded.org/mt/89803386/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
