Skip to contentSkip to conversation

recipetool npm regression fixes

PATCH New Paul Eggleton 1 participant 3 messages Aug 23, 2017

lore
Share & tools
lore
#0 lore raw

cover recipetool npm regression fixes

Fixes for a couple of regressions caused by recent patches to recipetool.

The following changes since commit f59e729f98ef9b506b0cfdc415567e03ec87f2a9:

runqemu: Use virtio to mount cdrom drives (2017-08-23 12:06:46 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/recipetool-npm-fixes2
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/recipetool-npm-fixes2

Paul Eggleton (2):
recipetool: create: fix broken import in npm module
recipetool: create: fix npm license code regression

 scripts/lib/recipetool/create_npm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.9.5
#1 lore raw

PATCH 1/2 recipetool: create: fix broken import in npm module

With "import oe" in create_npm.py you get "AttributeError: module 'oe' has no attribute 'package'" when it tries to call oe.package.npm_split_package_dirs().

---
 scripts/lib/recipetool/create_npm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/recipetool/create_npm.py +1 -1
index 07fcf4d..6252e91 100644
@@ -166,7 +166,7 @@ class NpmRecipeHandler(RecipeHandler):
 
     def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
         import bb.utils
-        import oe
+        import oe.package
         from collections import OrderedDict
 
         if 'buildsystem' in handled:
Signature · 1 line
2.9.5
#2 lore raw

PATCH 2/2 recipetool: create: fix npm license code regression

In reply to Paul Eggleton

OE-Core commit 1df60b09f7a60427795ec828c9c7180e4e52f98c caused a regression in npm handling since it still expected to be able to get the results of the license handling, but this no longer happens until after the npm plugin is called. Thus, call the license handling function ourselves here (which will record this as having been handled so it doesn't get done again later).

---
 scripts/lib/recipetool/create_npm.py | 3 +++
 1 file changed, 3 insertions(+)
scripts/lib/recipetool/create_npm.py +3 -0
index 6252e91..ae53972 100644
@@ -208,11 +208,14 @@ class NpmRecipeHandler(RecipeHandler):
 
                 # Split each npm module out to is own package
                 npmpackages = oe.package.npm_split_package_dirs(srctree)
+                licvalues = None
                 for item in handled:
                     if isinstance(item, tuple):
                         if item[0] == 'license':
                             licvalues = item[1]
                             break
+                if not licvalues:
+                    licvalues = handle_license_vars(srctree, lines_before, handled, extravalues, d)
                 if licvalues:
                     # Augment the license list with information we have in the packages
                     licenses = {}
Signature · 1 line
2.9.5