Skip to contentSkip to conversation

license_image.bbclass: fix missing recipeinfo on self

PATCH New Michael Ho 1 participant 1 message Jan 12, 2021

lore
Share & tools
lore

Michael Ho

author
#0 lore raw

PATCH 1/1 license_image.bbclass: fix missing recipeinfo on self

From: Michael Ho <[email protected]>

Resolve a build bug where image recipes with a do_deploy task will fail.

If the image recipe inheriting license_image.bbclass has a deploy task, then the function get_deployed_dependencies will add itself to the list of recipes to get license information for.

However, image recipes don't generally deploy license info so this results in an error.

File: '/nvme/poky/meta/classes/license_image.bbclass', lineno: 192, function: license_deployed_manifest
...
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/nvme/poky/build/tmp/deploy/licenses/core-image-minimal/recipeinfo'

Add a corner case to exclude the originating image recipe from the list of dependencies to check.

---
 meta/classes/license_image.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/license_image.bbclass +2 -1
index 119c8df..8fd88cf 100644
@@ -220,9 +220,10 @@ def get_deployed_dependencies(d):
     deploy = {}
     # Get all the dependencies for the current task (rootfs).
     taskdata = d.getVar("BB_TASKDEPDATA", False)
+    pn = d.getVar("PN", True)
     depends = list(set([dep[0] for dep
                     in list(taskdata.values())
-                    if not dep[0].endswith("-native")]))
+                    if not dep[0].endswith("-native") and not dep[0] == pn]))
 
     # To verify what was deployed it checks the rootfs dependencies against
     # the SSTATE_MANIFESTS for "deploy" task.
Signature · 1 line
2.7.4