diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-03-09 17:48:53 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 17:00:29 +0000 |
commit | 2279eb2a4cb82dc7033fcca97ecbed3ae09de902 (patch) | |
tree | 46f85ff16b0389fe6c11a4321ca7feb7ed87bb8a /scripts/lib | |
parent | 91455005b65db1b6caededbcac0f08a0cfb660f3 (diff) | |
download | poky-2279eb2a4cb82dc7033fcca97ecbed3ae09de902.tar.gz |
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.
(From OE-Core rev: a08d12ad867c292f7474731a0fe5e51e712446d6)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/recipetool/create.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 43c07848c2..1d48e36462 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -355,6 +355,12 @@ def create_recipe(args): | |||
355 | srcuri = rev_re.sub('', srcuri) | 355 | srcuri = rev_re.sub('', srcuri) |
356 | tempsrc = tempfile.mkdtemp(prefix='recipetool-') | 356 | tempsrc = tempfile.mkdtemp(prefix='recipetool-') |
357 | srctree = tempsrc | 357 | srctree = tempsrc |
358 | if fetchuri.startswith('npm://'): | ||
359 | # Check if npm is available | ||
360 | npm = bb.utils.which(tinfoil.config_data.getVar('PATH', True), 'npm') | ||
361 | if not npm: | ||
362 | logger.error('npm:// URL requested but npm is not available - you need to either build nodejs-native or install npm using your package manager') | ||
363 | sys.exit(1) | ||
358 | logger.info('Fetching %s...' % srcuri) | 364 | logger.info('Fetching %s...' % srcuri) |
359 | try: | 365 | try: |
360 | checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev) | 366 | checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev) |