]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: fetch2/npm: handle items only in optionalDependencies
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 6 Feb 2017 20:08:50 +0000 (09:08 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 7 Feb 2017 14:36:01 +0000 (14:36 +0000)
An npm package.json file has two dependency fields: dependencies and
optionalDependencies. An item in optionalDependencies *may* also be
listed in dependencies, but this is not required (and not necessary
since if it's in optionalDependencies it will be optional, adding it to
dependencies won't do anything). The code here was assuming that an
optional dependency would always be in both, that's probably because
that was true of the examples I was looking at at the time. To fix it,
just add the optional ones to the list we're iterating over.

(Bitbake rev: c0c50d43266150a80be31ae2c6fcaf37f5ba231d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/fetch2/npm.py

index 3e352922e07a4caeef355a5ea05bbdd0ffd9efe6..8c32f81c74060ce7613a8b3bf66d8ebb6a7f259f 100644 (file)
@@ -195,6 +195,7 @@ class Npm(FetchMethod):
 
         dependencies = pdata.get('dependencies', {})
         optionalDependencies = pdata.get('optionalDependencies', {})
+        dependencies.update(optionalDependencies)
         depsfound = {}
         optdepsfound = {}
         data[pkg]['deps'] = {}