summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/license.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/license.py')
-rw-r--r--meta/lib/oe/license.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index 31ca15b574..bc146a28c4 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -5,6 +5,20 @@ import ast
5import re 5import re
6from fnmatch import fnmatchcase as fnmatch 6from fnmatch import fnmatchcase as fnmatch
7 7
8def license_ok(license, dont_want_licenses):
9 """ Return False if License exist in dont_want_licenses else True """
10 for dwl in dont_want_licenses:
11 # If you want to exclude license named generically 'X', we
12 # surely want to exclude 'X+' as well. In consequence, we
13 # will exclude a trailing '+' character from LICENSE in
14 # case INCOMPATIBLE_LICENSE is not a 'X+' license.
15 lic = license
16 if not re.search('\+$', dwl):
17 lic = re.sub('\+', '', license)
18 if fnmatch(lic, dwl):
19 return False
20 return True
21
8class LicenseError(Exception): 22class LicenseError(Exception):
9 pass 23 pass
10 24