[OE-core] [PATCH 2/2] package.bbclass: add event with package file contents

Alex DAMIAN alexandru.damian at intel.com
Thu Sep 26 16:01:41 UTC 2013


From: Alexandru DAMIAN <alexandru.damian at intel.com>

In populate packages, the code breaks the artifacts
of the build process into separate directories for
each final package.

I'm adding code to use this opportunity and send out
a list of artifacts for each package together with the sizes.

This is needed in order to allow inspection of build artifacts
on remote clients.

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
---
 meta/classes/package.bbclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 67ee138..8f7ee3c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1025,6 +1025,20 @@ python populate_packages () {
             if ret is False or ret == 0:
                 raise bb.build.FuncFailed("File population failed")
 
+    for pkg in package_list:
+        pkg_info_data = { 'PKG' : pkg }
+        root = os.path.join(pkgdest, pkg)
+
+        os.chdir(root)
+        pkg_info_data['FILES'] = []
+        import subprocess
+        for path in subprocess.Popen("find . -type f", shell=True, bufsize=16384, stdout=subprocess.PIPE).communicate()[0].rstrip().split("\n"):
+            if len(path) > 0:
+                size = os.stat(path).st_size
+                pkg_info_data['FILES'].append((path, size))
+
+        bb.event.fire(bb.event.MetadataEvent("PackageFileSize",pkg_info_data), d)
+
     os.chdir(workdir)
 
     unshipped = []
-- 
1.8.1.2




More information about the Openembedded-core mailing list