summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-02-07 09:08:51 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-07 14:35:12 +0000
commit7aa6d1586417e0e7d9925917a82caee5884957db (patch)
tree79dbd8945c4680ccf07dc17b7fb5a8cf576c9563
parentc0c50d43266150a80be31ae2c6fcaf37f5ba231d (diff)
downloadbitbake-contrib-7aa6d1586417e0e7d9925917a82caee5884957db.zip
bitbake-contrib-7aa6d1586417e0e7d9925917a82caee5884957db.tar.gz
bitbake-contrib-7aa6d1586417e0e7d9925917a82caee5884957db.tar.bz2
fetch2/npm: fix handling of os field
When I originally added this check I didn't quite understand how the values in this field should be expressed - it seems from reading the documentation if there is an entry starting with '!' then the list is a blacklist and we shouldn't expect "linux" to be in the list, or we'll end up skipping important dependencies. This fixes fetching the "statsd" npm package. Fixes [YOCTO #10760]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/npm.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py
index 8c32f81..15b281f 100644
--- a/lib/bb/fetch2/npm.py
+++ b/lib/bb/fetch2/npm.py
@@ -182,7 +182,12 @@ class Npm(FetchMethod):
if pkg_os:
if not isinstance(pkg_os, list):
pkg_os = [pkg_os]
- if 'linux' not in pkg_os or '!linux' in pkg_os:
+ blacklist = False
+ for item in pkg_os:
+ if item.startswith('!'):
+ blacklist = True
+ break
+ if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
return
#logger.debug(2, "Output URL is %s - %s - %s" % (ud.basepath, ud.basename, ud.localfile))