summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/toaster.bbclass18
1 files changed, 15 insertions, 3 deletions
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index a7dd0aa854..55d0d28157 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -149,14 +149,26 @@ python toaster_image_dumpdata() {
149 image_name = d.getVar('IMAGE_NAME', True); 149 image_name = d.getVar('IMAGE_NAME', True);
150 150
151 image_info_data = {} 151 image_info_data = {}
152 artifact_info_data = {}
152 153
154 # collect all artifacts
153 for dirpath, dirnames, filenames in os.walk(deploy_dir_image): 155 for dirpath, dirnames, filenames in os.walk(deploy_dir_image):
154 for fn in filenames: 156 for fn in filenames:
155 if fn.startswith(image_name): 157 try:
156 image_output = os.path.join(dirpath, fn) 158 if fn.startswith(image_name):
157 image_info_data[image_output] = os.stat(image_output).st_size 159 image_output = os.path.join(dirpath, fn)
160 image_info_data[image_output] = os.stat(image_output).st_size
161 else:
162 import stat
163 artifact_path = os.path.join(dirpath, fn)
164 filestat = os.stat(artifact_path)
165 if stat.S_ISREG(filestat.st_mode):
166 artifact_info_data[artifact_path] = filestat.st_size
167 except OSError as e:
168 bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
158 169
159 bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d) 170 bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d)
171 bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize",artifact_info_data), d)
160} 172}
161 173
162 174