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.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
index 5914506a42..173e319cd5 100644
--- a/meta/lib/oe/license.py
+++ b/meta/lib/oe/license.py
@@ -86,8 +86,10 @@ def is_included(licensestr, whitelist=None, blacklist=None):
86 """ 86 """
87 87
88 def include_license(license): 88 def include_license(license):
89 return (any(fnmatch(license, pattern) for pattern in whitelist) and not 89 return any(fnmatch(license, pattern) for pattern in whitelist)
90 any(fnmatch(license, pattern) for pattern in blacklist)) 90
91 def exclude_license(license):
92 return any(fnmatch(license, pattern) for pattern in blacklist)
91 93
92 def choose_licenses(alpha, beta): 94 def choose_licenses(alpha, beta):
93 """Select the option in an OR which is the 'best' (has the most 95 """Select the option in an OR which is the 'best' (has the most
@@ -106,8 +108,9 @@ def is_included(licensestr, whitelist=None, blacklist=None):
106 blacklist = [] 108 blacklist = []
107 109
108 licenses = flattened_licenses(licensestr, choose_licenses) 110 licenses = flattened_licenses(licensestr, choose_licenses)
109 excluded = filter(lambda lic: not include_license(lic), licenses) 111 excluded = filter(lambda lic: exclude_license(lic), licenses)
112 included = filter(lambda lic: include_license(lic), licenses)
110 if excluded: 113 if excluded:
111 return False, excluded 114 return False, excluded
112 else: 115 else:
113 return True, None 116 return True, included