diff options
Diffstat (limited to 'meta/classes/packaged-staging.bbclass')
-rw-r--r-- | meta/classes/packaged-staging.bbclass | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass index 9b9ba16bf..5d0ee9aa9 100644 --- a/meta/classes/packaged-staging.bbclass +++ b/meta/classes/packaged-staging.bbclass @@ -63,6 +63,24 @@ python () { bb.data.setVarFlag('do_setscene', 'recrdeptask', deps, d) bb.data.setVar("PSTAGING_ACTIVE", "1", d) + + # + # Here we notice if the staging function is one of our standard staging + # routines. If it is, we can remvoe the need to lock staging and take + # timestamps which gives a nice speedup + # + fastpath = False + stagefunc = bb.data.getVar('do_stage', d, 1).strip() + if stagefunc == "autotools_stage_all": + fastpath = True + if stagefunc == "do_stage_native" and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1": + fastpath = True + if fastpath: + bb.note("Can optimise " + bb.data.getVar('FILE', d, 1)) + bb.data.setVar("PSTAGING_NEEDSTAMP", "0", d) + bb.data.setVar("STAGE_TEMP_PREFIX", "${WORKDIR}/temp-staging-pstage", d) + else: + bb.data.setVar("PSTAGING_NEEDSTAMP", "1", d) else: bb.data.setVar("PSTAGING_ACTIVE", "0", d) } @@ -297,14 +315,30 @@ populate_staging_postamble () { fi } -do_populate_staging[lockfiles] = "${STAGING_DIR}/staging.lock" +autotools_staging_pstage () { + mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/ + cp -fpPR ${WORKDIR}/temp-staging-pstage/${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ + cp -fpPR ${WORKDIR}/temp-staging-pstage/${STAGING_DIR}/* ${STAGING_DIR}/ +} + +#do_populate_staging[lockfiles] = "${STAGING_DIR}/staging.lock" do_populate_staging[dirs] =+ "${DEPLOY_DIR_PSTAGE}" python do_populate_staging_prepend() { - bb.build.exec_func("populate_staging_preamble", d) + needstamp = bb.data.getVar("PSTAGING_NEEDSTAMP", d, 1) + lock = bb.data.expand("${STAGING_DIR}/staging.lock", d) + if needstamp == "1": + stamplock = bb.utils.lockfile(lock) + bb.build.exec_func("populate_staging_preamble", d) } python do_populate_staging_append() { - bb.build.exec_func("populate_staging_postamble", d) + if needstamp == "1": + bb.build.exec_func("populate_staging_postamble", d) + bb.utils.unlockfile(stamplock) + else: + stamplock = bb.utils.lockfile(lock) + bb.build.exec_func("autotools_staging_pstage", d) + bb.utils.unlockfile(stamplock) } |