summaryrefslogtreecommitdiff
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:30 +0000
commitc1b1a6eb448aa1548e2ec669a9304b5a25bd8ba5 (patch)
treed64adf582beed22bf97f857994270e980490f158
parent118a2a44bbe5ed2e9bbd0012970686be454e5d4c (diff)
downloadopenembedded-core-c1b1a6eb448aa1548e2ec669a9304b5a25bd8ba5.tar.gz
openembedded-core-c1b1a6eb448aa1548e2ec669a9304b5a25bd8ba5.tar.bz2
openembedded-core-c1b1a6eb448aa1548e2ec669a9304b5a25bd8ba5.zip
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. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
if os.path.exists(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
+
+ process_list = [('file', 'bh_installed_pkgs.txt'),\
+ ('deps', 'bh_installed_pkgs_deps.txt')]
- pkgs_list_file = os.path.join(d.getVar('WORKDIR', True),
- "bh_installed_pkgs.txt")
+ for output_type, output_file in process_list:
+ output_file_full = os.path.join(d.getVar('WORKDIR', True), output_file)
- with open(pkgs_list_file, 'w') as pkgs_list:
- pkgs_list.write(list_installed_packages(d, 'file'))
+ with open(output_file_full, 'w') as output:
+ 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))
- pkgs_deps_file = os.path.join(d.getVar('WORKDIR', True),
- "bh_installed_pkgs_deps.txt")
+python buildhistory_list_installed_image() {
+ buildhistory_list_installed(d)
+}
- with open(pkgs_deps_file, 'w') as pkgs_deps:
- pkgs_deps.write(list_installed_packages(d, 'deps'))
+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() {
mkdir -p $1
@@ -471,15 +485,15 @@ END
}
# 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 ; "
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_list_installed ;\
+POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_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 ; "
SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "