aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/recipetool/create_npm.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-07-20 16:48:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-21 08:44:19 +0100
commit9a47a6690052ef943c0d4760630ee630fb012153 (patch)
tree09b54eea28dd1f556fe7cadabd98dda4d02854bd /scripts/lib/recipetool/create_npm.py
parentbe45e9b17e9dbc8c2594d3a939be377ab0720a7c (diff)
downloadopenembedded-core-contrib-9a47a6690052ef943c0d4760630ee630fb012153.tar.gz
recipetool: create: reimplement fetching with normal fetch/unpack tasks
Now that we have the ability to run the tasks in a more standard context through tinfoil, change recipetool's fetching code to use that to fetch files using it. This has the major advantage that any dependencies of do_fetch and do_unpack (e.g. for subversion or npm) will be handled automatically. This also has the beneficial side-effect of fixing a recent regression that prevented this fetch operation from working with memory resident bitbake. Also fix devtool's usage of fetch_uri() at the same time so that we can completely replace it. Fixes [YOCTO #11710]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool/create_npm.py')
-rw-r--r--scripts/lib/recipetool/create_npm.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index cb8f338b8b..ba7e39a406 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -109,7 +109,6 @@ class NpmRecipeHandler(RecipeHandler):
if varname == 'SRC_URI':
if not origvalue.startswith('npm://'):
src_uri = origvalue.split()
- changed = False
deplist = {}
for dep, depver in optdeps.items():
depdata = self.get_npm_data(dep, depver, d)
@@ -123,14 +122,15 @@ class NpmRecipeHandler(RecipeHandler):
depdata = self.get_npm_data(dep, depver, d)
deplist[dep] = depdata
+ extra_urls = []
for dep, depdata in deplist.items():
version = depdata.get('version', None)
if version:
url = 'npm://registry.npmjs.org;name=%s;version=%s;subdir=node_modules/%s' % (dep, version, dep)
- scriptutils.fetch_uri(d, url, srctree)
- src_uri.append(url)
- changed = True
- if changed:
+ extra_urls.append(url)
+ if extra_urls:
+ scriptutils.fetch_url(tinfoil, ' '.join(extra_urls), None, srctree, logger)
+ src_uri.extend(extra_urls)
return src_uri, None, -1, True
return origvalue, None, 0, True
updated, newlines = bb.utils.edit_metadata(lines_before, ['SRC_URI'], varfunc)