]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: create: fix for regression in npm license handling
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 12 Apr 2017 10:41:26 +0000 (22:41 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 12 Apr 2017 21:16:55 +0000 (22:16 +0100)
OE-Core commit c0cfd9b1d54b05ad048f444d6fe248aa0500159e added handling
for AND / OR in license strings coming from npm, but made the assumption
that an & would always be present in the license value. Check if it's
there first so we don't fail if it isn't.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/recipetool/create_npm.py

index a21502679e8c183e26cbeb422d0ea03d138181d8..eb19555a8ec885d85d7c79000a0e94b17a059eb8 100644 (file)
@@ -240,7 +240,8 @@ class NpmRecipeHandler(RecipeHandler):
                     packages['${PN}'] = ''
                     pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses)
                     all_licenses = list(set([item.replace('_', ' ') for pkglicense in pkglicenses.values() for item in pkglicense]))
-                    all_licenses.remove('&')
+                    if '&' in all_licenses:
+                        all_licenses.remove('&')
                     # Go back and update the LICENSE value since we have a bit more
                     # information than when that was written out (and we know all apply
                     # vs. there being a choice, so we can join them with &)