summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.bbclass
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-03-18 11:19:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-21 12:05:53 +0000
commit2cf83f49e313da750d7705d4118ee8734ce70e83 (patch)
treece1962d41c925ab51f1607c5fd32ac26cde7a1ac /meta/classes/buildhistory.bbclass
parent0ec27e63a358013d52b5015b5386ef738271460e (diff)
downloadpoky-2cf83f49e313da750d7705d4118ee8734ce70e83.tar.gz
buildhistory.bbclass: create proper dependency files for SDK
The old functions were calling the list_installed_packages() wrapper function that only listed the packages in an image rootfs. Even for target/host SDK. Also, a python crash was possible if 'bitbake -c populate_sdk core-image-*' was called without calling 'bitbake core-image-*' first. That's because the wrapper was always looking into the image rootfs... This commit fixes the problem and calls the right wrapper for image/sdk. (From OE-Core rev: c1b1a6eb448aa1548e2ec669a9304b5a25bd8ba5) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 ; "