From 35d095c282aa27bb2c5b90b9ebafeaa4a3de907e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 5 Oct 2010 22:21:34 +0100 Subject: bitbake/sstate: Implement a lookup function to speed up setscene processing Signed-off-by: Richard Purdie --- meta/classes/deploy.bbclass | 2 +- meta/classes/sstate.bbclass | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'meta/classes') diff --git a/meta/classes/deploy.bbclass b/meta/classes/deploy.bbclass index f697e70aa4..c3371421d8 100644 --- a/meta/classes/deploy.bbclass +++ b/meta/classes/deploy.bbclass @@ -1,6 +1,6 @@ DEPLOYDIR = "${WORKDIR}/deploy-${PN}" SSTATETASKS += "do_deploy" -do_deploy[sstate-name] = "deploy-${PN}" +do_deploy[sstate-name] = "deploy" do_deploy[sstate-inputdirs] = "${DEPLOYDIR}" do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 855f5a45a7..7f897ae54d 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -9,6 +9,8 @@ SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}" SSTATE_SCAN_CMD ?= "find ${SSTATE_BUILDDIR} \( -name "*.la" -o -name "*-config" \) -type f" +BB_HASHFILENAME = "${SSTATE_PKGNAME}" + python () { if bb.data.inherits_class('native', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.getVar('BUILD_ARCH', d), d) @@ -313,3 +315,27 @@ sstate_unpack_package () { cd ${SSTATE_INSTDIR} tar -xvzf ${SSTATE_PKG} } + +BB_HASHCHECK_FUNCTION = "sstate_checkhashes" + +def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d): + ret = [] + # This needs to go away, FIXME + mapping = { + "do_populate_sysroot" : "populate-sysroot", + "do_package_write_ipk" : "deploy-ipk", + "do_package_write_deb" : "deploy-deb", + "do_package_write_rpm" : "deploy-rpm", + "do_package" : "package", + "do_deploy" : "deploy", + } + + for task in range(len(sq_fn)): + sstatefile = bb.data.expand("${SSTATE_DIR}/" + sq_hashfn[task] + "_" + mapping[sq_task[task]] + ".tgz", d) + sstatefile= sstatefile.replace("${BB_TASKHASH}", sq_hash[task]) + #print("Checking for %s" % sstatefile) + if os.path.exists(sstatefile): + ret.append(task) + + return ret + -- cgit v1.2.3