[oe-commits] Alexandru DAMIAN : toaster.bbclass: read list of files in image

git at git.openembedded.org git at git.openembedded.org
Fri Apr 11 17:16:49 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 26eb3f4cd15227d67b65bdcaac465a11277b2b9d
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=26eb3f4cd15227d67b65bdcaac465a11277b2b9d

Author: Alexandru DAMIAN <alexandru.damian at intel.com>
Date:   Thu Mar  6 16:29:46 2014 +0000

toaster.bbclass: read list of files in image

We read the list of files in a built image and send it
over with the same event for packages in image.

(From OE-Core rev: 21bb659beca69c8bb379af2bf10afc843f529e57)

Signed-off-by: Alexandru DAMIAN <alexandru.damian at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/toaster.bbclass | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index cab5966..d2fa82d 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -241,10 +241,15 @@ python toaster_buildhistory_dump() {
     # scan the build targets for this build
     images = {}
     allpkgs = {}
+    files = {}
     for target in e._pkgs:
         installed_img_path = e.data.expand(os.path.join(BUILDHISTORY_DIR_IMAGE_BASE, target))
         if os.path.exists(installed_img_path):
             images[target] = {}
+            files[target] = {}
+            files[target]['dirs'] = []
+            files[target]['syms'] = []
+            files[target]['files'] = []
             with open("%s/installed-package-sizes.txt" % installed_img_path, "r") as fin:
                 for line in fin:
                     line = line.rstrip(";")
@@ -271,12 +276,22 @@ python toaster_buildhistory_dump() {
                             images[target][dependsname] = {'size': 0, 'depends' : []}
                         images[target][pname]['depends'].append((dependsname, deptype))
 
+            with open("%s/files-in-image.txt" % installed_img_path, "r") as fin:
+                for line in fin:
+                    lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
+                    if lc[0].startswith("l"):
+                        files[target]['syms'].append(lc)
+                    elif lc[0].startswith("d"):
+                        files[target]['dirs'].append(lc)
+                    else:
+                        files[target]['files'].append(lc)
+
             for pname in images[target]:
                 if not pname in allpkgs:
                     allpkgs[pname] = _toaster_load_pkgdatafile("%s/runtime-reverse/" % pkgdata_dir, pname)
 
 
-    data = { 'pkgdata' : allpkgs, 'imgdata' : images }
+    data = { 'pkgdata' : allpkgs, 'imgdata' : images, 'filedata' : files }
 
     bb.event.fire(bb.event.MetadataEvent("ImagePkgList", data), e.data)
 



More information about the Openembedded-commits mailing list