diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-09-06 10:57:31 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-08 00:33:46 +0100 |
commit | 3a0f5d95a7b6fc3557702c7fcd07ec64d37d2736 (patch) | |
tree | ccc8c7bd74b85168e5b3d12d772652118addfcd7 /bitbake/lib | |
parent | 5ab68677140ad6ffab7fbdeee6caeb19f4d80cba (diff) | |
download | poky-3a0f5d95a7b6fc3557702c7fcd07ec64d37d2736.tar.gz |
bitbake: fetch2/npm: handle top-level shrinkwrap file
Allow using a top-level shrinkwrap file with one or more npm://
dependencies, i.e. if the module isn't found at the top level then look
one level down.
Part of the fix for [YOCTO #9537].
(Bitbake rev: f7de3f8b5f628dee043fe783148812914ab20813)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/fetch2/npm.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/npm.py b/bitbake/lib/bb/fetch2/npm.py index 134bd35221..08d6876524 100644 --- a/bitbake/lib/bb/fetch2/npm.py +++ b/bitbake/lib/bb/fetch2/npm.py | |||
@@ -204,8 +204,15 @@ class Npm(FetchMethod): | |||
204 | for dep, version in depsfound.items(): | 204 | for dep, version in depsfound.items(): |
205 | self._getdependencies(dep, data[pkg]['deps'], version, d, ud) | 205 | self._getdependencies(dep, data[pkg]['deps'], version, d, ud) |
206 | 206 | ||
207 | def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest): | 207 | def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest, toplevel=True): |
208 | logger.debug(2, "NPM shrinkwrap file is %s" % data) | 208 | logger.debug(2, "NPM shrinkwrap file is %s" % data) |
209 | if toplevel: | ||
210 | name = data.get('name', None) | ||
211 | if name and name != pkg: | ||
212 | for obj in data.get('dependencies', []): | ||
213 | if obj == pkg: | ||
214 | self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False) | ||
215 | return | ||
209 | outputurl = "invalid" | 216 | outputurl = "invalid" |
210 | if ('resolved' not in data) or (not data['resolved'].startswith('http')): | 217 | if ('resolved' not in data) or (not data['resolved'].startswith('http')): |
211 | # will be the case for ${PN} | 218 | # will be the case for ${PN} |
@@ -231,7 +238,7 @@ class Npm(FetchMethod): | |||
231 | if 'dependencies' in data: | 238 | if 'dependencies' in data: |
232 | for obj in data['dependencies']: | 239 | for obj in data['dependencies']: |
233 | logger.debug(2, "Found dep is %s" % str(obj)) | 240 | logger.debug(2, "Found dep is %s" % str(obj)) |
234 | self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest[pkg]['deps']) | 241 | self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest[pkg]['deps'], False) |
235 | 242 | ||
236 | def download(self, ud, d): | 243 | def download(self, ud, d): |
237 | """Fetch url""" | 244 | """Fetch url""" |