diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-07-20 16:48:11 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-21 08:44:25 +0100 |
commit | e4346e8be5f451d5cfe0b68a272abd15b0951831 (patch) | |
tree | fee60446d4319e5e771c2e809fc8a21278d00983 /scripts/lib/recipetool/create_npm.py | |
parent | 7d474e27bc851b22b7c00ace66ac40ea45588054 (diff) | |
download | poky-e4346e8be5f451d5cfe0b68a272abd15b0951831.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].
(From OE-Core rev: 9a47a6690052ef943c0d4760630ee630fb012153)
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.py | 10 |
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): | |||
109 | if varname == 'SRC_URI': | 109 | if varname == 'SRC_URI': |
110 | if not origvalue.startswith('npm://'): | 110 | if not origvalue.startswith('npm://'): |
111 | src_uri = origvalue.split() | 111 | src_uri = origvalue.split() |
112 | changed = False | ||
113 | deplist = {} | 112 | deplist = {} |
114 | for dep, depver in optdeps.items(): | 113 | for dep, depver in optdeps.items(): |
115 | depdata = self.get_npm_data(dep, depver, d) | 114 | depdata = self.get_npm_data(dep, depver, d) |
@@ -123,14 +122,15 @@ class NpmRecipeHandler(RecipeHandler): | |||
123 | depdata = self.get_npm_data(dep, depver, d) | 122 | depdata = self.get_npm_data(dep, depver, d) |
124 | deplist[dep] = depdata | 123 | deplist[dep] = depdata |
125 | 124 | ||
125 | extra_urls = [] | ||
126 | for dep, depdata in deplist.items(): | 126 | for dep, depdata in deplist.items(): |
127 | version = depdata.get('version', None) | 127 | version = depdata.get('version', None) |
128 | if version: | 128 | if version: |
129 | url = 'npm://registry.npmjs.org;name=%s;version=%s;subdir=node_modules/%s' % (dep, version, dep) | 129 | url = 'npm://registry.npmjs.org;name=%s;version=%s;subdir=node_modules/%s' % (dep, version, dep) |
130 | scriptutils.fetch_uri(d, url, srctree) | 130 | extra_urls.append(url) |
131 | src_uri.append(url) | 131 | if extra_urls: |
132 | changed = True | 132 | scriptutils.fetch_url(tinfoil, ' '.join(extra_urls), None, srctree, logger) |
133 | if changed: | 133 | src_uri.extend(extra_urls) |
134 | return src_uri, None, -1, True | 134 | return src_uri, None, -1, True |
135 | return origvalue, None, 0, True | 135 | return origvalue, None, 0, True |
136 | updated, newlines = bb.utils.edit_metadata(lines_before, ['SRC_URI'], varfunc) | 136 | updated, newlines = bb.utils.edit_metadata(lines_before, ['SRC_URI'], varfunc) |