If image recipe depends on another image recipe it will try to use
license recipeinfo that is not deployed. It will result in:
| Exception: FileNotFoundError: [Errno 2] No such file or directory:
| 'TMPDIR/deploy/licenses/foo-image/recipeinfo'

In such case check for image_license.manifest file (which means dep is
an image recipe) and skip if true.

Signed-off-by: Tomasz Dziendzielski <[email protected]>
Signed-off-by: Jan Brzezanski <[email protected]>
Signed-off-by: Ricardo Rodrigues <[email protected]>
Signed-off-by: Szymon Czarnuch <[email protected]>
Signed-off-by: Kamil Kwiek <[email protected]>
---
 meta/classes/license_image.bbclass | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/meta/classes/license_image.bbclass 
b/meta/classes/license_image.bbclass
index bf70bee99b..cc1d9ea651 100644
--- a/meta/classes/license_image.bbclass
+++ b/meta/classes/license_image.bbclass
@@ -201,10 +201,17 @@ def license_deployed_manifest(d):
         man_dic[dep]["PN"] = dep
         man_dic[dep]["FILES"] = \
             " ".join(get_deployed_files(dep_dic[dep]))
-        with open(os.path.join(lic_dir, dep, "recipeinfo"), "r") as f:
-            for line in f.readlines():
-                key,val = line.split(": ", 1)
-                man_dic[dep][key] = val[:-1]
+        try:
+            with open(os.path.join(lic_dir, dep, "recipeinfo"), "r") as f:
+                for line in f.readlines():
+                    key,val = line.split(": ", 1)
+                    man_dic[dep][key] = val[:-1]
+        except FileNotFoundError:
+            if os.path.exists(os.path.join(
+                    lic_dir, "%s-%s" % (dep, d.getVar("MACHINE")), 
"image_license.manifest")):
+                del man_dic[dep]
+            else:
+                raise
 
     lic_manifest_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'),
                                     d.getVar('IMAGE_NAME'))
-- 
2.33.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#157375): 
https://lists.openembedded.org/g/openembedded-core/message/157375
Mute This Topic: https://lists.openembedded.org/mt/86597669/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to