All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peter Kjellerstedt" <peter.kjellerstedt@axis.com>
To: Meh Mbeh Ida Delphine <idadelm@gmail.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [poky-contrib][PATCH 2/4] package.bbclass: Displays warnings for just licences in recipes.
Date: Fri, 12 Mar 2021 16:57:54 +0000	[thread overview]
Message-ID: <ce71f7e3ef024d27989c5b8c1a0dc1b0@XBOX03.axis.com> (raw)
In-Reply-To: <20210309233130.104839-2-idadelm@gmail.com>

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Meh Mbeh Ida Delphine
> Sent: den 10 mars 2021 00:31
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [poky-contrib][PATCH 2/4] package.bbclass: Displays
> warnings for just licences in recipes.
> 
> After the comparism between computedpkglics and recipe lics, the warnings
> are displayed if and only if there are licenses in the recipes not found
> in the sources.
> 
> Signed-off-by: Ida Delphine <idadelm@gmail.com>
> ---
>  meta/classes/package.bbclass | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index c127178f95..4e1be661b3 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1551,6 +1551,7 @@ PKGDESTWORK = "${WORKDIR}/pkgdata"
>  PKGDATA_VARS = "PN PE PV PR PKGE PKGV PKGR LICENSE DESCRIPTION SUMMARY RDEPENDS RPROVIDES RRECOMMENDS RSUGGESTS RREPLACES RCONFLICTS SECTION PKG ALLOW_EMPTY FILES CONFFILES FILES_INFO PACKAGE_ADD_METADATA pkg_postinst pkg_postrm pkg_preinst pkg_prerm"
> 
>  python emit_pkgdata() {
> +    import oe.license
>      from glob import glob
>      import json
>      import subprocess
> @@ -1748,8 +1749,8 @@ fi
>                      if r[0] not in computedlics:
>                          computedlics[r[0]] = set()
>                      computedlics[r[0]].add(filelics[subf])
> -        #if computedlics:
> -        #    bb.warn(str(computedlics))
> +
> +

One empty line is enough.

>          dvar = d.getVar('PKGD')
>          for f in computedlics:
>              shortf = f.replace(dvar, "")
> @@ -1762,13 +1763,19 @@ fi
>                      computedpkglics[pkg].update(computedlics[f])
>              if not found:
>                  bb.warn("%s not in %s" % (f, str(filemap)))
> -        #if computedpkglics:
> -        #    bb.warn(str(computedpkglics))
> +
>          for pkg in computedpkglics:
>              lic = d.getVar('LICENSE_%s' % (pkg))
>              if not lic:
>                  lic = d.getVar('LICENSE')
> -            bb.warn("License for package %s is %s vs %s" % (pkg, computedpkglics[pkg], lic))
> +
> +            # Splits the LICENSE values and canonicalise each license
> +            # in the set of split license(s)
> +            spdx_lic = oe.license.split_spdx_lic(lic, d)
> +
> +            # Displays warnings for licenses found in the recipes and not sources
> +            if spdx_lic - computedpkglics[pkg]:
> +                bb.warn("License for package %s is %s vs %s" % (pkg, computedpkglics[pkg], spdx_lic))
>  }
>  emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides"

Since you are now using a function from oe.license that references 
Bitbake variables, I believe you should add emit_pkgdata[vardeps] 
for those variables as bitbake will not pick them up automatically.

> 
> --
> 2.25.1

//Peter


  reply	other threads:[~2021-03-12 16:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 23:31 [poky-contrib][PATCH 1/4] oe.license: Add functions to split and canonicalise license strings Meh Mbeh Ida Delphine
2021-03-09 23:31 ` [poky-contrib][PATCH 2/4] package.bbclass: Displays warnings for just licences in recipes Meh Mbeh Ida Delphine
2021-03-12 16:57   ` Peter Kjellerstedt [this message]
2021-03-09 23:31 ` [poky-contrib][PATCH 3/4] package.bbclass: Add handle_qa_error check Meh Mbeh Ida Delphine
2021-03-12 16:44   ` [OE-core] " Peter Kjellerstedt
2021-03-12 16:54     ` Christopher Larson
2021-03-12 16:59       ` Richard Purdie
2021-03-12 17:29         ` Meh Mbeh Ida Delphine
2021-03-09 23:31 ` [poky-contrib][PATCH 4/4] Moved logic to get filelics from package.bbclass to license.py Meh Mbeh Ida Delphine
2021-03-12 16:18   ` [OE-core] " Peter Kjellerstedt
2021-03-12 17:38     ` Meh Mbeh Ida Delphine
2021-03-12 15:59 ` [OE-core] [poky-contrib][PATCH 1/4] oe.license: Add functions to split and canonicalise license strings Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce71f7e3ef024d27989c5b8c1a0dc1b0@XBOX03.axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=idadelm@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.