]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/lib/create_npm: rewrite see license in eula
authorAnders Darander <anders@chargestorm.se>
Wed, 1 Mar 2017 17:19:59 +0000 (18:19 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 4 Mar 2017 10:42:32 +0000 (10:42 +0000)
Rewrite the 'SEE LICENSE IN EULA' to a single string (without
spaces), to avoid splitting the string later on.

(Otherwise, each word gets split, and assumed to be a license
on it's own.

Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/recipetool/create_npm.py

index d3fcd99deb8b9b2ad860d0fcbbf7259e28145eae..3a88592b732a6d70f1061dc86ddc7d3399ef71ea 100644 (file)
@@ -45,8 +45,10 @@ class NpmRecipeHandler(RecipeHandler):
             license = data['license']
             if isinstance(license, dict):
                 license = license.get('type', None)
-            if 'MIT/X11' in license:
-                license = 'MIT'
+            if license:
+                license = license.replace('MIT/X11', 'MIT')
+                license = license.replace('SEE LICENSE IN EULA',
+                                          'SEE-LICENSE-IN-EULA')
         return license
 
     def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before):