summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass40
1 files changed, 27 insertions, 13 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 5d0a229f99..262095f60a 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -313,22 +313,36 @@ def write_pkghistory(pkginfo, d):
313 if os.path.exists(filevarpath): 313 if os.path.exists(filevarpath):
314 os.unlink(filevarpath) 314 os.unlink(filevarpath)
315 315
316python buildhistory_list_installed() { 316#
317 from oe.rootfs import list_installed_packages 317# rootfs_type can be: image, sdk_target, sdk_host
318#
319def buildhistory_list_installed(d, rootfs_type="image"):
320 from oe.rootfs import image_list_installed_packages
321 from oe.sdk import sdk_list_installed_packages
322
323 process_list = [('file', 'bh_installed_pkgs.txt'),\
324 ('deps', 'bh_installed_pkgs_deps.txt')]
318 325
319 pkgs_list_file = os.path.join(d.getVar('WORKDIR', True), 326 for output_type, output_file in process_list:
320 "bh_installed_pkgs.txt") 327 output_file_full = os.path.join(d.getVar('WORKDIR', True), output_file)
321 328
322 with open(pkgs_list_file, 'w') as pkgs_list: 329 with open(output_file_full, 'w') as output:
323 pkgs_list.write(list_installed_packages(d, 'file')) 330 if rootfs_type == "image":
331 output.write(image_list_installed_packages(d, output_type))
332 else:
333 output.write(sdk_list_installed_packages(d, rootfs_type == "sdk_target", output_type))
324 334
325 pkgs_deps_file = os.path.join(d.getVar('WORKDIR', True), 335python buildhistory_list_installed_image() {
326 "bh_installed_pkgs_deps.txt") 336 buildhistory_list_installed(d)
337}
327 338
328 with open(pkgs_deps_file, 'w') as pkgs_deps: 339python buildhistory_list_installed_sdk_target() {
329 pkgs_deps.write(list_installed_packages(d, 'deps')) 340 buildhistory_list_installed(d, "sdk_target")
330} 341}
331 342
343python buildhistory_list_installed_sdk_host() {
344 buildhistory_list_installed(d, "sdk_host")
345}
332 346
333buildhistory_get_installed() { 347buildhistory_get_installed() {
334 mkdir -p $1 348 mkdir -p $1
@@ -471,15 +485,15 @@ END
471} 485}
472 486
473# By prepending we get in before the removal of packaging files 487# By prepending we get in before the removal of packaging files
474ROOTFS_POSTPROCESS_COMMAND =+ " buildhistory_list_installed ;\ 488ROOTFS_POSTPROCESS_COMMAND =+ " buildhistory_list_installed_image ;\
475 buildhistory_get_image_installed ; " 489 buildhistory_get_image_installed ; "
476 490
477IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; " 491IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; "
478 492
479# We want these to be the last run so that we get called after complementary package installation 493# We want these to be the last run so that we get called after complementary package installation
480POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed ;\ 494POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target ;\
481 buildhistory_get_sdk_installed_target ; " 495 buildhistory_get_sdk_installed_target ; "
482POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed ;\ 496POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host ;\
483 buildhistory_get_sdk_installed_host ; " 497 buildhistory_get_sdk_installed_host ; "
484 498
485SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; " 499SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "