Thanks for the feedback. I will get rid of the logic to take care of those
licenses with "or-later" and move the functions to license.py. Does this
also mean I shouldn't try removing "WITH-Linux-syscall-note" from the
licences? The point of me doing that was for there to be more matches and
the number of warnings reduced.

Also there is more license-related logic in package.bbclass. Will it be
okay if I move it as well to meta/lib/oe/license.py putting it in functions?

Cheers,
Ida.

On Wed, Feb 17, 2021 at 5:36 PM Richard Purdie <
[email protected]> wrote:

> On Wed, 2021-02-17 at 15:04 +0000, Peter Kjellerstedt wrote:
> > > -----Original Message-----
> > > From: [email protected] <openembedded-
> > > [email protected]> On Behalf Of Meh Mbeh Ida Delphine
> > > Sent: den 17 februari 2021 05:01
> > > To: [email protected]
> > > Subject: [OE-core] [poky-contrib][RFC PATCH 4/5] license.bbclass: Add
> > > functions to split and canonicalise license strings
> > >
> > > These functions that will later be used in package.bbclass simply make
> the
> > > source and recipe licenses in the same format so that they can easily
> be
> > > compared and the ouput warnings filtered accordingly.
> > > split_spdx_lic() splits the license strings and returns a set of the
> > > canonicalised licenses.
> > > rem_false_lics() does two things:
> > > - Converts '-or-later' licenses to their canonicalised form
> > > - Gets rid of "WITH Linux-syscall-note" from license string if
> specified
> > > in local.conf
> > >
> > > Signed-off-by: Ida Delphine <[email protected]>
> > > ---
> > >  meta/classes/license.bbclass | 27 +++++++++++++++++++++++++++
> > >  1 file changed, 27 insertions(+)
> > >
> > > diff --git a/meta/classes/license.bbclass
> b/meta/classes/license.bbclass
> > > index dc91118340..576464cb26 100644
> > > --- a/meta/classes/license.bbclass
> > > +++ b/meta/classes/license.bbclass
> > > @@ -435,3 +435,30 @@ python do_populate_lic_setscene () {
> > >      sstate_setscene(d)
> > >  }
> > >  addtask do_populate_lic_setscene
> > > +
> > > +
> > > +def split_spdx_lic(d, licensestr):
> > > +    """
> > > +    Split the license strings and returns a set of the
> > > +    canonicalised licenses.
> > > +    """
> > > +    import oe.license
> > > +    split_lic = oe.license.list_licenses(licensestr)
> > > +    spdx_lic = set([canonical_license(d, l) for l in split_lic])
> > > +    return spdx_lic
> > > +
> > > +def rem_false_lics(d, pkglic):
> > > +    pkglicsperpkg = set([])
> > > +    for l in pkglic:
> > > +        if l.endswith('-or-later'):
> > > +            # Converts '-or-later' licenses to their canonicalised
> form
> > > +            lic_ = l.replace('-or-later', '+')
> >
> > Given that licenses such as "GPL-2.0+" are deprecated by SPDX, shouldn't
> we
> > instead introduce the canonical "GPL-2.0-only" and "GPL-2.0-or-later"?
> > And then add mappings for, e.g., "GPL-2.0" to "GPL-2.0-only" and
> "GPL-2.0+"
> > to "GPL-2.0-or-later".
>
> Something like:
>
> http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&id=1c2ce4565bc85915ab970e42bf7af3a78ec2dd6a
> ?
>
> :)
>
> > > +            pkglicsperpkg.add(lic_)
> > > +        elif l.endswith(' WITH Linux-syscall-note'):
> > > +        # Gets rid of "WITH Linux-syscall-note from license sring"
> > > +            if d.getVar("LICENSE_WITH_LINUX_SYS") == "1":
> > > +                lic_ = l.replace(' WITH Linux-syscall-note', '')
> >
> > Looking at https://spdx.org/licenses/exceptions-index.html, there is a
> long
> > list of predefined exceptions and "Linux-syscall-note" is just one of
> them.
> > We probably want a more generic solution for how to handle exceptions.
>
> Agreed, I was trying to make that point in one of my replies!
>
> Cheers,
>
> Richard
> >
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#148247): 
https://lists.openembedded.org/g/openembedded-core/message/148247
Mute This Topic: https://lists.openembedded.org/mt/80697040/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to