summaryrefslogtreecommitdiffstats
path: root/meta/lib/test.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-01-09 15:02:34 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-17 14:53:19 +0000
commit7ce97336aad5e6ecefb5e735a13e345d1b8bd8fb (patch)
tree270b4abfa31518895add0e9f2fbea7722288d07c /meta/lib/test.py
parent49a0821376ef6146345d673b1e9eddd34aee931a (diff)
downloadpoky-7ce97336aad5e6ecefb5e735a13e345d1b8bd8fb.tar.gz
oe.license: add is_included convenience function
Given a license string and whitelist and blacklist, determine if the license string matches the whitelist and does not match the blacklist. When encountering an OR, it prefers the side with the highest weight (more included licenses). It then checks the inclusion of the flattened list of licenses from there. Returns a tuple holding the boolean state and a list of the applicable licenses which were excluded (or None, if the state is True) Examples: is_included, excluded = oe.license.is_included(licensestr, ['GPL*', 'LGPL*']) is_included, excluded = oe.license.is_included(licensestr, blacklist=['Proprietary', 'CLOSED']) (From OE-Core rev: 7903433898b4683a1c09cc9a6a379421bc9bbd58) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/test.py')
-rw-r--r--meta/lib/test.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/lib/test.py b/meta/lib/test.py
new file mode 100644
index 0000000000..12f4d837dd
--- /dev/null
+++ b/meta/lib/test.py
@@ -0,0 +1,3 @@
1import oe.license
2
3print(oe.license.is_included('LGPLv2.1 | GPLv3', ['*'], []))