[oe-commits] [openembedded-core] 39/41: recipetool: create: check if npm available if npm:// URL specified
git at git.openembedded.org
git at git.openembedded.org
Wed Mar 9 16:59:23 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit ad3d4b269a026e2dc8ed2c535e8f3f1b7585fcf4
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Wed Mar 9 17:48:53 2016 +1300
recipetool: create: check if npm available if npm:// URL specified
If the user specifies an npm:// URL then the fetcher needs npm to be
available to run, so check if it's available early rather than failing
later.
Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
scripts/lib/recipetool/create.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 43c0784..1d48e36 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -355,6 +355,12 @@ def create_recipe(args):
srcuri = rev_re.sub('', srcuri)
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
srctree = tempsrc
+ if fetchuri.startswith('npm://'):
+ # Check if npm is available
+ npm = bb.utils.which(tinfoil.config_data.getVar('PATH', True), 'npm')
+ if not npm:
+ logger.error('npm:// URL requested but npm is not available - you need to either build nodejs-native or install npm using your package manager')
+ sys.exit(1)
logger.info('Fetching %s...' % srcuri)
try:
checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list