diff options
-rw-r--r-- | scripts/lib/recipetool/create_npm.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py index 3a88592b73..72ceb953e2 100644 --- a/scripts/lib/recipetool/create_npm.py +++ b/scripts/lib/recipetool/create_npm.py | |||
@@ -46,6 +46,19 @@ class NpmRecipeHandler(RecipeHandler): | |||
46 | if isinstance(license, dict): | 46 | if isinstance(license, dict): |
47 | license = license.get('type', None) | 47 | license = license.get('type', None) |
48 | if license: | 48 | if license: |
49 | if 'OR' in license: | ||
50 | license = license.replace('OR', '|') | ||
51 | license = license.replace('AND', '&') | ||
52 | license = license.replace(' ', '_') | ||
53 | if not license[0] == '(': | ||
54 | license = '(' + license + ')' | ||
55 | print('LICENSE: {}'.format(license)) | ||
56 | else: | ||
57 | license = license.replace('AND', '&') | ||
58 | if license[0] == '(': | ||
59 | license = license[1:] | ||
60 | if license[-1] == ')': | ||
61 | license = license[:-1] | ||
49 | license = license.replace('MIT/X11', 'MIT') | 62 | license = license.replace('MIT/X11', 'MIT') |
50 | license = license.replace('SEE LICENSE IN EULA', | 63 | license = license.replace('SEE LICENSE IN EULA', |
51 | 'SEE-LICENSE-IN-EULA') | 64 | 'SEE-LICENSE-IN-EULA') |
@@ -220,7 +233,8 @@ class NpmRecipeHandler(RecipeHandler): | |||
220 | packages = OrderedDict((x,y[0]) for x,y in npmpackages.items()) | 233 | packages = OrderedDict((x,y[0]) for x,y in npmpackages.items()) |
221 | packages['${PN}'] = '' | 234 | packages['${PN}'] = '' |
222 | pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses) | 235 | pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses) |
223 | all_licenses = list(set([item for pkglicense in pkglicenses.values() for item in pkglicense])) | 236 | all_licenses = list(set([item.replace('_', ' ') for pkglicense in pkglicenses.values() for item in pkglicense])) |
237 | all_licenses.remove('&') | ||
224 | # Go back and update the LICENSE value since we have a bit more | 238 | # Go back and update the LICENSE value since we have a bit more |
225 | # information than when that was written out (and we know all apply | 239 | # information than when that was written out (and we know all apply |
226 | # vs. there being a choice, so we can join them with &) | 240 | # vs. there being a choice, so we can join them with &) |