mirror of
https://git.yoctoproject.org/poky
synced 2026-09-12 06:49:32 +02:00
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]. (From OE-Core rev: 9a47a6690052ef943c0d4760630ee630fb012153) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7d474e27bc
commit
e4346e8be5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user