Openembedded Core Discussions
 help / color / mirror / Atom feed
From: <Hugo.Jacob@bmw.de>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH v2 1/1] buildhistory.bbclass: Add license declaration to packages and recipes
Date: Wed, 1 Mar 2017 13:21:43 +0000	[thread overview]
Message-ID: <1488374504121.73746@bmw.de> (raw)

Having the license declaration in the buildhistory is useful to track
licenses changes, licenses going to a given image and etc. This change
adds the license declaration for recipes and packages to its
buildhistory data.

Signed-off-by: Hugo Jacob <Hugo.Jacob@bmw.de>
---
 meta/classes/buildhistory.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 3a5bc2c3e3..f6525dfd72 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -83,6 +83,7 @@ python buildhistory_emit_pkghistory() {
             self.pe = "0"
             self.pv = "0"
             self.pr = "r0"
+            self.license = ""
             self.depends = ""
             self.packages = ""
             self.srcrev = ""
@@ -94,6 +95,7 @@ python buildhistory_emit_pkghistory() {
             self.pe = "0"
             self.pv = "0"
             self.pr = "r0"
+            self.license = ""
             # pkg/pkge/pkgv/pkgr should be empty because we want to be able to default them
             self.pkg = ""
             self.pkge = ""
@@ -186,6 +188,7 @@ python buildhistory_emit_pkghistory() {
     pe = d.getVar('PE', True) or "0"
     pv = d.getVar('PV', True)
     pr = d.getVar('PR', True)
+    license = d.getVar('LICENSE', True)

     pkgdata_dir = d.getVar('PKGDATA_DIR', True)
     packages = ""
@@ -223,6 +226,7 @@ python buildhistory_emit_pkghistory() {
     rcpinfo.pe = pe
     rcpinfo.pv = pv
     rcpinfo.pr = pr
+    rcpinfo.license = license
     rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS', True) or ""))
     rcpinfo.packages = packages
     write_recipehistory(rcpinfo, d)
@@ -241,6 +245,7 @@ python buildhistory_emit_pkghistory() {
         pkge = pkgdata.get('PKGE', '0')
         pkgv = pkgdata['PKGV']
         pkgr = pkgdata['PKGR']
+        pkg_license = d.getVar('LICENSE_%s' % pkg, True) or license
         #
         # Find out what the last version was
         # Make sure the version did not decrease
@@ -261,6 +266,7 @@ python buildhistory_emit_pkghistory() {
         pkginfo.pv = pkgdata['PV']
         pkginfo.pr = pkgdata['PR']
         pkginfo.pkg = pkgdata['PKG']
+        pkginfo.license = pkg_license
         pkginfo.pkge = pkge
         pkginfo.pkgv = pkgv
         pkginfo.pkgr = pkgr
@@ -301,6 +307,7 @@ def write_recipehistory(rcpinfo, d):
             f.write(u"PE = %s\n" %  rcpinfo.pe)
         f.write(u"PV = %s\n" %  rcpinfo.pv)
         f.write(u"PR = %s\n" %  rcpinfo.pr)
+        f.write(u"LICENSE = %s\n" %  rcpinfo.license)
         f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
         f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)

@@ -320,6 +327,7 @@ def write_pkghistory(pkginfo, d):
             f.write(u"PE = %s\n" %  pkginfo.pe)
         f.write(u"PV = %s\n" %  pkginfo.pv)
         f.write(u"PR = %s\n" %  pkginfo.pr)
+        f.write(u"LICENSE = %s\n" %  pkginfo.license)

         if pkginfo.pkg != pkginfo.name:
             f.write(u"PKG = %s\n" % pkginfo.pkg)
--
2.11.0

             reply	other threads:[~2017-03-01 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 13:21 Hugo.Jacob [this message]
2017-03-01 22:16 ` [PATCH v2 1/1] buildhistory.bbclass: Add license declaration to packages and recipes Burton, Ross

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=1488374504121.73746@bmw.de \
    --to=hugo.jacob@bmw.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox