Patchwork [2/3] buildhistory.bbclass: fix creation of installed packages list

login
register
mail settings
Submitter Laurentiu Palcu
Date Feb. 19, 2014, 10:51 a.m.
Message ID <a07a699adf67131b74c95049143cb2d6314015a2.1392806896.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/66971/
State New
Headers show

Comments

Laurentiu Palcu - Feb. 19, 2014, 10:51 a.m.
Call the new python routines to create the packages list.

[YOCTO #5831]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/buildhistory.bbclass |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Patch

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 0033b5a..ef4135b 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -311,13 +311,23 @@  def write_pkghistory(pkginfo, d):
             if os.path.exists(filevarpath):
                 os.unlink(filevarpath)
 
+python buildhistory_list_installed() {
+    from oe.rootfs import list_installed_packages
+
+    pkgs_list_file = os.path.join(d.getVar('WORKDIR', True),
+                                  "bh_installed_pkgs.txt")
+
+    with open(pkgs_list_file, 'w') as pkgs_list:
+        pkgs_list.write(list_installed_packages(d, 'file'))
+}
+
 
 buildhistory_get_installed() {
 	mkdir -p $1
 
 	# Get list of installed packages
 	pkgcache="$1/installed-packages.tmp"
-	list_installed_packages file | sort > $pkgcache
+	cat ${WORKDIR}/bh_installed_pkgs.txt | sort > $pkgcache && rm ${WORKDIR}/bh_installed_pkgs.txt
 
 	cat $pkgcache | awk '{ print $1 }' > $1/installed-package-names.txt
 	if [ -s $pkgcache ] ; then
@@ -452,13 +462,16 @@  END
 }
 
 # By prepending we get in before the removal of packaging files
-ROOTFS_POSTPROCESS_COMMAND =+ "buildhistory_get_image_installed ; "
+ROOTFS_POSTPROCESS_COMMAND =+ " buildhistory_list_installed ;\
+                                buildhistory_get_image_installed ; "
 
 IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; "
 
 # We want these to be the last run so that we get called after complementary package installation
-POPULATE_SDK_POST_TARGET_COMMAND_append = "buildhistory_get_sdk_installed_target ; "
-POPULATE_SDK_POST_HOST_COMMAND_append = "buildhistory_get_sdk_installed_host ; "
+POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed ;\
+                                            buildhistory_get_sdk_installed_target ; "
+POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed ;\
+                                          buildhistory_get_sdk_installed_host ; "
 
 SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "