Patchwork [1/1] toaster.bbclass: do not fail on non-existent files

login
register
mail settings
Submitter Paul Eggleton
Date April 11, 2014, 4:40 p.m.
Message ID <b0b7b081006b8cbac0aebff5af7bb88d7a4088c9.1397234393.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/70525/
State Accepted, archived
Headers show

Comments

Paul Eggleton - April 11, 2014, 4:40 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

Toaster may look up inexistent file paths in the build history
for packages that have been referenced but not built.

This triggers a failure, and this patch recovers by deleting
the reference to the non-built packages.

[YOCTO #6063]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/toaster.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index cab5966..15cfbd8 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -273,7 +273,15 @@  python toaster_buildhistory_dump() {
 
             for pname in images[target]:
                 if not pname in allpkgs:
-                    allpkgs[pname] = _toaster_load_pkgdatafile("%s/runtime-reverse/" % pkgdata_dir, pname)
+                    try:
+                        pkgdata = _toaster_load_pkgdatafile("%s/runtime-reverse/" % pkgdata_dir, pname)
+                    except IOError as err:
+                        if err.errno == 2:
+                            # We expect this e.g. for RRECOMMENDS that are unsatisfied at runtime
+                            continue
+                        else:
+                            raise
+                    allpkgs[pname] = pkgdata
 
 
     data = { 'pkgdata' : allpkgs, 'imgdata' : images }