Yocto Project Documentation
 help / color / mirror / Atom feed
From: "Peter Kjellerstedt" <peter.kjellerstedt@axis.com>
To: <docs@lists.yoctoproject.org>
Subject: [Resend][PATCH 5/5] ref-manual: Add a tips on how to achieve whitelisting of licenses
Date: Thu, 20 Feb 2020 21:27:33 +0100	[thread overview]
Message-ID: <20200220202733.21907-5-pkj@axis.com> (raw)
In-Reply-To: <20200220202733.21907-1-pkj@axis.com>

It is sometimes more appropriate to define the licenses that are
allowed to be used rather than the ones that are not permitted. This
adds a tips on how this can be achieved by using AVAILABLE_LICENSES
and some Python set arithmetics.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 documentation/ref-manual/ref-variables.xml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/documentation/ref-manual/ref-variables.xml b/documentation/ref-manual/ref-variables.xml
index 9e6d37ec0d..7ab37de317 100644
--- a/documentation/ref-manual/ref-variables.xml
+++ b/documentation/ref-manual/ref-variables.xml
@@ -6774,6 +6774,25 @@
                     components that are required to produce a functional system
                     image.
                 </note>
+
+                <note><title>Tips</title>
+                    It is possible to define a list of licenses that are allowed
+                    to be used instead of the licenses that are excluded. To do
+                    this, define a
+                    variable <filename>COMPATIBLE_LICENSES</filename> with the
+                    names of the licences that are allowed. Then
+                    define <filename>INCOMPATIBLE_LICENSE</filename> as:
+                    <literallayout class='monospaced'>
+     INCOMPATIBLE_LICENSE = "${@' '.join(sorted(set(d.getVar('AVAILABLE_LICENSES').split()) - set(d.getVar('COMPATIBLE_LICENSES').split())))}"
+                    </literallayout>
+                    This will result
+                    in <filename>INCOMPATIBLE_LICENSE</filename> containing the
+                    names of all licences
+                    from <link linkend='var-AVAILABLE_LICENSES'><filename>AVAILABLE_LICENSES</filename></link>
+                    except the ones specified
+                    in <filename>COMPATIBLE_LICENSES</filename>, thus only
+                    allowing the latter licences to be used.
+                </note>
             </glossdef>
         </glossentry>
 
-- 
2.21.1


      parent reply	other threads:[~2020-02-20 20:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 20:27 [Resend][PATCH 1/5] ref-manual: The sanity_info file has moved from build/conf to build/cache Peter Kjellerstedt
2020-02-20 20:27 ` [Resend][PATCH 2/5] ref-manual: Add missing/remove extraneous quotes Peter Kjellerstedt
2020-02-20 20:27 ` [Resend][PATCH 3/5] ref-manual: Update the documentation for USERADD_ERROR_DYNAMIC Peter Kjellerstedt
2020-02-20 20:27 ` [Resend][PATCH 4/5] ref-manual: Add a variable description for AVAILABLE_LICENSES Peter Kjellerstedt
2020-02-20 20:27 ` Peter Kjellerstedt [this message]

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=20200220202733.21907-5-pkj@axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=docs@lists.yoctoproject.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