From 983ea373362514e5888bd1d7d9c4f136c94b00f2 Mon Sep 17 00:00:00 2001 From: Mariano Lopez Date: Mon, 18 Jan 2016 14:33:06 +0000 Subject: lib/oe/rootfs: Use list_pkgs() instead of list() This patch changes the use list_pkgs() instead of list() from class RpmPkgsList. The change is in two functions, image_list_installed_packages from rootfs.py and sdk_list_installed_packages from sdk.py. With this change the functions calling the functions listed above, must format the output as they required. The formatting can be done using format_pkg_list() from oe.utils. The classes calling the afected functions are changed too with this patch, to keep the same functionality using the new data structure. [YOCTO #7427] Signed-off-by: Mariano Lopez Signed-off-by: Ross Burton --- meta/classes/buildhistory.bbclass | 11 +++++++---- meta/classes/license.bbclass | 8 ++++++-- meta/classes/populate_sdk_base.bbclass | 8 ++++++-- meta/classes/rootfs-postcommands.bbclass | 4 +++- 4 files changed, 22 insertions(+), 9 deletions(-) (limited to 'meta/classes') diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index 2c144abb97..9f1744293a 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -337,18 +337,21 @@ def write_pkghistory(pkginfo, d): def buildhistory_list_installed(d, rootfs_type="image"): from oe.rootfs import image_list_installed_packages from oe.sdk import sdk_list_installed_packages + from oe.utils import format_pkg_list process_list = [('file', 'bh_installed_pkgs.txt'),\ ('deps', 'bh_installed_pkgs_deps.txt')] + if rootfs_type == "image": + pkgs = image_list_installed_packages(d) + else: + pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target") + for output_type, output_file in process_list: output_file_full = os.path.join(d.getVar('WORKDIR', True), output_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)) + output.write(format_pkg_list(pkgs, output_type)) python buildhistory_list_installed_image() { buildhistory_list_installed(d) diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 8a42874600..301216d5d6 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -21,8 +21,12 @@ python write_package_manifest() { license_image_dir = d.expand('${LICENSE_DIRECTORY}/${IMAGE_NAME}') bb.utils.mkdirhier(license_image_dir) from oe.rootfs import image_list_installed_packages + from oe.utils import format_pkg_list + + pkgs = image_list_installed_packages(d) + output = format_pkg_list(pkgs) open(os.path.join(license_image_dir, 'package.manifest'), - 'w+').write(image_list_installed_packages(d)) + 'w+').write(output) } python write_deploy_manifest() { @@ -38,7 +42,7 @@ python license_create_manifest() { return 0 pkg_dic = {} - for pkg in image_list_installed_packages(d).splitlines(): + for pkg in sorted(image_list_installed_packages(d)): pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True), 'runtime-reverse', pkg) pkg_name = os.path.basename(os.readlink(pkg_info)) diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index 7ca1df67a2..99b64f7429 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass @@ -62,20 +62,24 @@ SDK_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest" SDK_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest" python write_target_sdk_manifest () { from oe.sdk import sdk_list_installed_packages + from oe.utils import format_pkg_list sdkmanifestdir = os.path.dirname(d.getVar("SDK_TARGET_MANIFEST", True)) + pkgs = sdk_list_installed_packages(d, True) if not os.path.exists(sdkmanifestdir): bb.utils.mkdirhier(sdkmanifestdir) with open(d.getVar('SDK_TARGET_MANIFEST', True), 'w') as output: - output.write(sdk_list_installed_packages(d, True, 'ver')) + output.write(format_pkg_list(pkgs, 'ver')) } python write_host_sdk_manifest () { from oe.sdk import sdk_list_installed_packages + from oe.utils import format_pkg_list sdkmanifestdir = os.path.dirname(d.getVar("SDK_HOST_MANIFEST", True)) + pkgs = sdk_list_installed_packages(d, False) if not os.path.exists(sdkmanifestdir): bb.utils.mkdirhier(sdkmanifestdir) with open(d.getVar('SDK_HOST_MANIFEST', True), 'w') as output: - output.write(sdk_list_installed_packages(d, False, 'ver')) + output.write(format_pkg_list(pkgs, 'ver')) } POPULATE_SDK_POST_TARGET_COMMAND_append = " write_target_sdk_manifest ; " diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index 970e9f34b1..0736d6c533 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass @@ -207,13 +207,15 @@ insert_feed_uris () { python write_image_manifest () { from oe.rootfs import image_list_installed_packages + from oe.utils import format_pkg_list deploy_dir = d.getVar('DEPLOY_DIR_IMAGE', True) link_name = d.getVar('IMAGE_LINK_NAME', True) manifest_name = d.getVar('IMAGE_MANIFEST', True) + pkgs = image_list_installed_packages(d) with open(manifest_name, 'w+') as image_manifest: - image_manifest.write(image_list_installed_packages(d, 'ver')) + image_manifest.write(format_pkg_list(pkgs, "ver")) image_manifest.write("\n") if manifest_name is not None and os.path.exists(manifest_name): -- cgit 1.2.3-korg