1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

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>
This commit is contained in:
Laurentiu Palcu
2014-03-18 11:19:20 +00:00
committed by Richard Purdie
parent 0ec27e63a3
commit 2cf83f49e3
+27 -13
View File
@@ -313,22 +313,36 @@ def write_pkghistory(pkginfo, d):
if os.path.exists(filevarpath): if os.path.exists(filevarpath):
os.unlink(filevarpath) os.unlink(filevarpath)
python buildhistory_list_installed() { #
from oe.rootfs import list_installed_packages # rootfs_type can be: image, sdk_target, sdk_host
#
def buildhistory_list_installed(d, rootfs_type="image"):
from oe.rootfs import image_list_installed_packages
from oe.sdk import sdk_list_installed_packages
pkgs_list_file = os.path.join(d.getVar('WORKDIR', True), process_list = [('file', 'bh_installed_pkgs.txt'),\
"bh_installed_pkgs.txt") ('deps', 'bh_installed_pkgs_deps.txt')]
with open(pkgs_list_file, 'w') as pkgs_list: for output_type, output_file in process_list:
pkgs_list.write(list_installed_packages(d, 'file')) output_file_full = os.path.join(d.getVar('WORKDIR', True), output_file)
pkgs_deps_file = os.path.join(d.getVar('WORKDIR', True), with open(output_file_full, 'w') as output:
"bh_installed_pkgs_deps.txt") if rootfs_type == "image":
output.write(image_list_installed_packages(d, output_type))
else:
output.write(sdk_list_installed_packages(d, rootfs_type == "sdk_target", output_type))
with open(pkgs_deps_file, 'w') as pkgs_deps: python buildhistory_list_installed_image() {
pkgs_deps.write(list_installed_packages(d, 'deps')) buildhistory_list_installed(d)
} }
python buildhistory_list_installed_sdk_target() {
buildhistory_list_installed(d, "sdk_target")
}
python buildhistory_list_installed_sdk_host() {
buildhistory_list_installed(d, "sdk_host")
}
buildhistory_get_installed() { buildhistory_get_installed() {
mkdir -p $1 mkdir -p $1
@@ -471,15 +485,15 @@ END
} }
# By prepending we get in before the removal of packaging files # By prepending we get in before the removal of packaging files
ROOTFS_POSTPROCESS_COMMAND =+ " buildhistory_list_installed ;\ ROOTFS_POSTPROCESS_COMMAND =+ " buildhistory_list_installed_image ;\
buildhistory_get_image_installed ; " buildhistory_get_image_installed ; "
IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; " IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; "
# We want these to be the last run so that we get called after complementary package installation # We want these to be the last run so that we get called after complementary package installation
POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed ;\ POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target ;\
buildhistory_get_sdk_installed_target ; " buildhistory_get_sdk_installed_target ; "
POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed ;\ POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host ;\
buildhistory_get_sdk_installed_host ; " buildhistory_get_sdk_installed_host ; "
SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; " SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "