From a099ed2125fbd822342b7fc124e3c659b26d29c9 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 4 Jan 2023 13:18:03 +0000 Subject: package: Move pkgdata handling functions to oe.packagedata To avoid reparsing the bbclass code all the time, move the functions to the packagedata python function library code which is more efficient. (From OE-Core rev: f520a3039540b1183b1b2bdaaf8b9195995c0187) Signed-off-by: Richard Purdie --- meta/classes-recipe/image.bbclass | 7 ++++--- meta/classes-recipe/populate_sdk_base.bbclass | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'meta/classes-recipe') diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass index e387645503..a06c9f544d 100644 --- a/meta/classes-recipe/image.bbclass +++ b/meta/classes-recipe/image.bbclass @@ -203,6 +203,7 @@ fakeroot python do_rootfs () { from oe.rootfs import create_rootfs from oe.manifest import create_manifest import logging + import oe.packagedata logger = d.getVar('BB_TASK_LOGGER', False) if logger: @@ -247,9 +248,9 @@ fakeroot python do_rootfs () { # otherwise, the multilib renaming could step in and squash any fixups that # may have occurred. pn = d.getVar('PN') - runtime_mapping_rename("PACKAGE_INSTALL", pn, d) - runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d) - runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d) + oe.packagedata.runtime_mapping_rename("PACKAGE_INSTALL", pn, d) + oe.packagedata.runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d) + oe.packagedata.runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d) # Generate the initial manifest create_manifest(d) diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass index 917619962c..7cc9535356 100644 --- a/meta/classes-recipe/populate_sdk_base.bbclass +++ b/meta/classes-recipe/populate_sdk_base.bbclass @@ -162,6 +162,7 @@ SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; archive_sdk; $ def populate_sdk_common(d): from oe.sdk import populate_sdk from oe.manifest import create_manifest, Manifest + import oe.packagedata # Handle package exclusions excl_pkgs = (d.getVar("PACKAGE_EXCLUDE") or "").split() @@ -184,13 +185,13 @@ def populate_sdk_common(d): d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs)) pn = d.getVar('PN') - runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d) - runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d) + oe.packagedata.runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d) + oe.packagedata.runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d) ld = bb.data.createCopy(d) ld.setVar("PKGDATA_DIR", "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}/pkgdata") - runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld) - runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld) + oe.packagedata.runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld) + oe.packagedata.runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld) d.setVar("TOOLCHAIN_HOST_TASK", ld.getVar("TOOLCHAIN_HOST_TASK")) d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY")) -- cgit v1.2.3-54-g00ecf