summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-04-12 22:41:29 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-13 10:54:10 +0100
commit40d17719441c3e6865b0f35b40c2f98386671903 (patch)
treefcee780ddced467028a31ba1c9bf6a1e03754f82 /scripts
parent48f8d1201a0342ba5253c276df504fcb986b8245 (diff)
downloadpoky-40d17719441c3e6865b0f35b40c2f98386671903.tar.gz
recipetool: create: hide missing npm error when called from devtool
If devtool is called with a URL to a source repository containing a node.js module, we don't know that until recipetool has fetched it, and due to the structure of the code we have to exit with a special code in order to let devtool know it needs to build nodejs-native. We also want to suppress the error message that recipetool would normally print under these circumstances; there is already a mechanism for this but it wasn't operative in the case where we're pointed to a source repository rather than an npm:// URL, so create some plumbing so that we know to hide the message. (From OE-Core rev: 0c2d0fbb1c6c5b82183799eb7ef80074f86bcfc4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create.py4
-rw-r--r--scripts/lib/recipetool/create_npm.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 439dca0fcc..5af58a12f7 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -59,6 +59,9 @@ class RecipeHandler(object):
59 recipecmakefilemap = {} 59 recipecmakefilemap = {}
60 recipebinmap = {} 60 recipebinmap = {}
61 61
62 def __init__(self):
63 self._devtool = False
64
62 @staticmethod 65 @staticmethod
63 def load_libmap(d): 66 def load_libmap(d):
64 '''Load library->recipe mapping''' 67 '''Load library->recipe mapping'''
@@ -622,6 +625,7 @@ def create_recipe(args):
622 handlers.sort(key=lambda item: (item[1], -item[2]), reverse=True) 625 handlers.sort(key=lambda item: (item[1], -item[2]), reverse=True)
623 for handler, priority, _ in handlers: 626 for handler, priority, _ in handlers:
624 logger.debug('Handler: %s (priority %d)' % (handler.__class__.__name__, priority)) 627 logger.debug('Handler: %s (priority %d)' % (handler.__class__.__name__, priority))
628 setattr(handler, '_devtool', args.devtool)
625 handlers = [item[0] for item in handlers] 629 handlers = [item[0] for item in handlers]
626 630
627 # Apply the handlers 631 # Apply the handlers
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index a79a9afbb1..cb8f338b8b 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -189,7 +189,7 @@ class NpmRecipeHandler(RecipeHandler):
189 files = RecipeHandler.checkfiles(srctree, ['package.json']) 189 files = RecipeHandler.checkfiles(srctree, ['package.json'])
190 if files: 190 if files:
191 d = bb.data.createCopy(tinfoil.config_data) 191 d = bb.data.createCopy(tinfoil.config_data)
192 npm_bindir = check_npm(tinfoil) 192 npm_bindir = check_npm(tinfoil, self._devtool)
193 d.prependVar('PATH', '%s:' % npm_bindir) 193 d.prependVar('PATH', '%s:' % npm_bindir)
194 194
195 data = read_package_json(files[0]) 195 data = read_package_json(files[0])