summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-06-26 14:29:30 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-02 16:12:37 +0100
commita225c162e6a2097e724e53cb0a0be8d89131148b (patch)
treedcfd72b11511dfaabbe2d67aaea282b8ab0c3b1d /scripts
parent36b750b1d8e07ad47931a490453418a3f3a8ee43 (diff)
downloadpoky-a225c162e6a2097e724e53cb0a0be8d89131148b.tar.gz
checklayer: parse LAYERDEPENDS with bb.utils.explode_dep_versions2()
LAYERDEPENDS is a string of this format: "DEPEND1 (optional version) DEPEND2 (optional version) ..." However when we parse LAYERDEPENDS in _get_layer_collections() we parse it as a simple string, and if any optional versions are there the 'depends' field is wrong. For example, running yocto-check-layer might result in such errors: ERROR: Layer meta-python depends on (>= and isn't found. ERROR: Layer meta-python depends on 12) and isn't found. Let's use bb.utils.explode_dep_versions2() to parse LAYERDEPENDS, and create a string that contains all dependencies, effectively skipping/ignoring any optional versions. [YOCTO #13957] (From OE-Core rev: 819f41906197bb712af37349c0865002bfbd7c9b) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f81f07afc200fe06c5c06ea81a4f8a3a43436faf) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/checklayer/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py
index 1138000275..f625d59896 100644
--- a/scripts/lib/checklayer/__init__.py
+++ b/scripts/lib/checklayer/__init__.py
@@ -59,9 +59,14 @@ def _get_layer_collections(layer_path, lconf=None, data=None):
59 pattern = ldata.getVar('BBFILE_PATTERN_%s' % name) 59 pattern = ldata.getVar('BBFILE_PATTERN_%s' % name)
60 depends = ldata.getVar('LAYERDEPENDS_%s' % name) 60 depends = ldata.getVar('LAYERDEPENDS_%s' % name)
61 compat = ldata.getVar('LAYERSERIES_COMPAT_%s' % name) 61 compat = ldata.getVar('LAYERSERIES_COMPAT_%s' % name)
62 try:
63 depDict = bb.utils.explode_dep_versions2(depends or "")
64 except bb.utils.VersionStringException as vse:
65 bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (name, str(vse)))
66
62 collections[name]['priority'] = priority 67 collections[name]['priority'] = priority
63 collections[name]['pattern'] = pattern 68 collections[name]['pattern'] = pattern
64 collections[name]['depends'] = depends 69 collections[name]['depends'] = ' '.join(depDict.keys())
65 collections[name]['compat'] = compat 70 collections[name]['compat'] = compat
66 71
67 return collections 72 return collections