diff options
Diffstat (limited to 'meta/lib/oe/license.py')
-rw-r--r-- | meta/lib/oe/license.py | 14 |
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 | |||
5 | import re | 5 | import re |
6 | from fnmatch import fnmatchcase as fnmatch | 6 | from fnmatch import fnmatchcase as fnmatch |
7 | 7 | ||
8 | def 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 | |||
8 | class LicenseError(Exception): | 22 | class LicenseError(Exception): |
9 | pass | 23 | pass |
10 | 24 | ||