]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lib/oe/recipeutils.py: add support for BBFILES_DYNAMIC
authorNaveen Saini <naveen.kumar.saini@intel.com>
Fri, 21 Aug 2020 01:00:36 +0000 (09:00 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Aug 2020 07:27:33 +0000 (08:27 +0100)
Instead of relying on value of BBFILES from bitbake, devtool
parses the layer.conf because the layer might not be in bblayers.conf.
And it currently does not consider the value of BBFILES_DYNAMIC because
of which recipes, in paths defined by BBFILES_DYNAMIC, upgraded
using devtool end up in wrong location.

Include the code from bitbake to append values to BBFILES based on
what is in BBFILES_DYNAMIC too.

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/recipeutils.py

index 36427eec9186953e71849dd6e01bbdc17c3cf7a7..ef69ef207f4a1e3a7043c0895770ff49d21915c0 100644 (file)
@@ -563,6 +563,23 @@ def get_bbfile_path(d, destdir, extrapathhint=None):
     confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata)
     pn = d.getVar('PN')
 
+    # Parse BBFILES_DYNAMIC and append to BBFILES
+    bbfiles_dynamic = (confdata.getVar('BBFILES_DYNAMIC') or "").split()
+    collections = (confdata.getVar('BBFILE_COLLECTIONS') or "").split()
+    invalid = []
+    for entry in bbfiles_dynamic:
+        parts = entry.split(":", 1)
+        if len(parts) != 2:
+            invalid.append(entry)
+            continue
+        l, f = parts
+        invert = l[0] == "!"
+        if invert:
+            l = l[1:]
+        if (l in collections and not invert) or (l not in collections and invert):
+            confdata.appendVar("BBFILES", " " + f)
+    if invalid:
+        return None
     bbfilespecs = (confdata.getVar('BBFILES') or '').split()
     if destdir == destlayerdir:
         for bbfilespec in bbfilespecs: