diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2020-02-20 21:27:33 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-11 14:41:44 +0000 |
commit | 0daf901b5be2c1e3ac7e4c274b293e4679ecc10d (patch) | |
tree | c251c82d560405cfa6ab6d089498a292fa6002a0 /documentation | |
parent | cc26e90a79c87eb3d1130456294ce8e24135d483 (diff) | |
download | poky-0daf901b5be2c1e3ac7e4c274b293e4679ecc10d.tar.gz |
ref-manual: Add a tips on how to achieve whitelisting of licenses
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.
(From yocto-docs rev: dd26d8a9f89402a9828bf02f2e65054d4c0f406f)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/ref-manual/ref-variables.xml | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ | |||
6774 | components that are required to produce a functional system | 6774 | components that are required to produce a functional system |
6775 | image. | 6775 | image. |
6776 | </note> | 6776 | </note> |
6777 | |||
6778 | <note><title>Tips</title> | ||
6779 | It is possible to define a list of licenses that are allowed | ||
6780 | to be used instead of the licenses that are excluded. To do | ||
6781 | this, define a | ||
6782 | variable <filename>COMPATIBLE_LICENSES</filename> with the | ||
6783 | names of the licences that are allowed. Then | ||
6784 | define <filename>INCOMPATIBLE_LICENSE</filename> as: | ||
6785 | <literallayout class='monospaced'> | ||
6786 | INCOMPATIBLE_LICENSE = "${@' '.join(sorted(set(d.getVar('AVAILABLE_LICENSES').split()) - set(d.getVar('COMPATIBLE_LICENSES').split())))}" | ||
6787 | </literallayout> | ||
6788 | This will result | ||
6789 | in <filename>INCOMPATIBLE_LICENSE</filename> containing the | ||
6790 | names of all licences | ||
6791 | from <link linkend='var-AVAILABLE_LICENSES'><filename>AVAILABLE_LICENSES</filename></link> | ||
6792 | except the ones specified | ||
6793 | in <filename>COMPATIBLE_LICENSES</filename>, thus only | ||
6794 | allowing the latter licences to be used. | ||
6795 | </note> | ||
6777 | </glossdef> | 6796 | </glossdef> |
6778 | </glossentry> | 6797 | </glossentry> |
6779 | 6798 | ||