Hello, A gentle reminder to please review this patch. Cheers, Ida.
On Tue, 16 Mar 2021, 9:49 am Meh Mbeh Ida Delphine via lists.openembedded.org, <[email protected]> wrote: > These functions ensures recipe LICENSE strings are split into their > individual licenses and then canonicalised to easily enable their matching > with licenses of sources during the packaging process. > > Signed-off-by: Ida Delphine <[email protected]> > --- > meta/lib/oe/license.py | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py > index c1274a61de..dc1bc6682c 100644 > --- a/meta/lib/oe/license.py > +++ b/meta/lib/oe/license.py > @@ -243,3 +243,22 @@ def list_licenses(licensestr): > except SyntaxError as exc: > raise LicenseSyntaxError(licensestr, exc) > return visitor.licenses > + > +def canonical_license(license, d): > + """ > + Return the canonical (SPDX) form of the license if available (so GPLv3 > + becomes GPL-3.0), for the license named 'X+', return canonical form of > + 'X' if available and the tailing '+' (so GPLv3+ becomes GPL-3.0+), > + or the passed license if there is no canonical form. > + """ > + lic = d.getVarFlag('SPDXLICENSEMAP', license) or "" > + return lic or license > + > +def split_spdx_lic(licensestr,d): > + """ > + Split the license strings and returns a set of the > + canonicalised licenses. > + """ > + split_lic = list_licenses(licensestr) > + spdx_lic = set([canonical_license(l, d) for l in split_lic]) > + return spdx_lic > -- > 2.25.1 > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#150012): https://lists.openembedded.org/g/openembedded-core/message/150012 Mute This Topic: https://lists.openembedded.org/mt/81653195/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
