From: Nicolas Dechesne Date: Fri, 26 Jun 2020 12:29:30 +0000 (+0200) Subject: checklayer: parse LAYERDEPENDS with bb.utils.explode_dep_versions2() X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~10663 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f81f07afc200fe06c5c06ea81a4f8a3a43436faf;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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] Signed-off-by: Nicolas Dechesne Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 11380002751..f625d598967 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): pattern = ldata.getVar('BBFILE_PATTERN_%s' % name) depends = ldata.getVar('LAYERDEPENDS_%s' % name) compat = ldata.getVar('LAYERSERIES_COMPAT_%s' % name) + try: + depDict = bb.utils.explode_dep_versions2(depends or "") + except bb.utils.VersionStringException as vse: + bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (name, str(vse))) + collections[name]['priority'] = priority collections[name]['pattern'] = pattern - collections[name]['depends'] = depends + collections[name]['depends'] = ' '.join(depDict.keys()) collections[name]['compat'] = compat return collections