]> code.ossystems Code Review - openembedded-core.git/commitdiff
toaster.bbclass: trigger event for other image files
authorAlexandru DAMIAN <alexandru.damian@intel.com>
Wed, 10 Dec 2014 14:44:59 +0000 (14:44 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 19 Dec 2014 17:54:13 +0000 (17:54 +0000)
Toaster will log all the files that it can find in the
deploy images directory, and list them, considering that
they may be artifacts of the current build not logged
anywhere else.

[YOCTO #6836]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/toaster.bbclass

index a7dd0aa8548e2611ee04f0baacfe1c42725e6027..55d0d281570bad1440223d736fc1a315afc21369 100644 (file)
@@ -149,14 +149,26 @@ python toaster_image_dumpdata() {
     image_name = d.getVar('IMAGE_NAME', True);
 
     image_info_data = {}
+    artifact_info_data = {}
 
+    # collect all artifacts
     for dirpath, dirnames, filenames in os.walk(deploy_dir_image):
         for fn in filenames:
-            if fn.startswith(image_name):
-                image_output = os.path.join(dirpath, fn)
-                image_info_data[image_output] = os.stat(image_output).st_size
+            try:
+                if fn.startswith(image_name):
+                    image_output = os.path.join(dirpath, fn)
+                    image_info_data[image_output] = os.stat(image_output).st_size
+                else:
+                    import stat
+                    artifact_path = os.path.join(dirpath, fn)
+                    filestat = os.stat(artifact_path)
+                    if stat.S_ISREG(filestat.st_mode):
+                        artifact_info_data[artifact_path] = filestat.st_size
+            except OSError as e:
+                bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
 
     bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d)
+    bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize",artifact_info_data), d)
 }