summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/recipetool/create.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 5d7fcbbb98..ef0ba974a9 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -18,6 +18,7 @@ from urllib.parse import urlparse, urldefrag, urlsplit
18import hashlib 18import hashlib
19import bb.fetch2 19import bb.fetch2
20logger = logging.getLogger('recipetool') 20logger = logging.getLogger('recipetool')
21from oe.license import tidy_licenses
21from oe.license_finder import find_licenses 22from oe.license_finder import find_licenses
22 23
23tinfoil = None 24tinfoil = None
@@ -950,16 +951,6 @@ def fixup_license(value):
950 return '(' + value + ')' 951 return '(' + value + ')'
951 return value 952 return value
952 953
953def tidy_licenses(value):
954 """Flat, split and sort licenses"""
955 from oe.license import flattened_licenses
956 def _choose(a, b):
957 str_a, str_b = sorted((" & ".join(a), " & ".join(b)), key=str.casefold)
958 return ["(%s | %s)" % (str_a, str_b)]
959 if not isinstance(value, str):
960 value = " & ".join(value)
961 return sorted(list(set(flattened_licenses(value, _choose))), key=str.casefold)
962
963def handle_license_vars(srctree, lines_before, handled, extravalues, d): 954def handle_license_vars(srctree, lines_before, handled, extravalues, d):
964 lichandled = [x for x in handled if x[0] == 'license'] 955 lichandled = [x for x in handled if x[0] == 'license']
965 if lichandled: 956 if lichandled: