summaryrefslogtreecommitdiffstats
path: root/meta/classes/packaged-staging.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-02 20:43:22 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-13 12:15:23 +0000
commitd7399bd56c8fc7c58af79ef91dc67382cc23eb47 (patch)
tree40b56eb43f211fbe6bd79d70bc61018e2dcb5751 /meta/classes/packaged-staging.bbclass
parenta1d93ee3260d8161c7ae14674e01b516b952dea9 (diff)
downloadpoky-d7399bd56c8fc7c58af79ef91dc67382cc23eb47.tar.gz
base.bbclass: Rework staging function to use a DESTDIR style configuration based on the data from the do_install step. This falls back to any standard do_stage function if defined, see the mailing list for more info.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/packaged-staging.bbclass')
-rw-r--r--meta/classes/packaged-staging.bbclass53
1 files changed, 11 insertions, 42 deletions
diff --git a/meta/classes/packaged-staging.bbclass b/meta/classes/packaged-staging.bbclass
index 6df13876c2..44f657a2c0 100644
--- a/meta/classes/packaged-staging.bbclass
+++ b/meta/classes/packaged-staging.bbclass
@@ -63,29 +63,6 @@ python () {
63 bb.data.setVarFlag('do_setscene', 'recrdeptask', deps, d) 63 bb.data.setVarFlag('do_setscene', 'recrdeptask', deps, d)
64 64
65 bb.data.setVar("PSTAGING_ACTIVE", "1", d) 65 bb.data.setVar("PSTAGING_ACTIVE", "1", d)
66
67 #
68 # Here we notice if the staging function is one of our standard staging
69 # routines. If it is, we can remvoe the need to lock staging and take
70 # timestamps which gives a nice speedup
71 #
72 fastpath = False
73 stagefunc = bb.data.getVar('do_stage', d, 1).strip()
74 if stagefunc == "autotools_stage_all":
75 fastpath = True
76 elif stagefunc == "base_do_stage":
77 fastpath = True
78 elif stagefunc == "do_stage_native" and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
79 fastpath = True
80 if bb.data.getVar('PSTAGE_BROKEN_DESTDIR', d, 1) == "1":
81 fastpath = False
82 if fastpath:
83 #bb.note("Optimised for staging: " + bb.data.getVar('FILE', d, 1))
84 bb.data.setVar("PSTAGING_NEEDSTAMP", "0", d)
85 bb.data.setVar("STAGE_TEMP_PREFIX", "${WORKDIR}/temp-staging-pstage", d)
86 else:
87 #bb.note("Can optimise staging better: " + bb.data.getVar('FILE', d, 1))
88 bb.data.setVar("PSTAGING_NEEDSTAMP", "1", d)
89 else: 66 else:
90 bb.data.setVar("PSTAGING_ACTIVE", "0", d) 67 bb.data.setVar("PSTAGING_ACTIVE", "0", d)
91} 68}
@@ -320,30 +297,22 @@ populate_staging_postamble () {
320 fi 297 fi
321} 298}
322 299
323autotools_staging_pstage () { 300packagedstageing_fastpath () {
324 mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/ 301 if [ "$PSTAGING_ACTIVE" = "1" ]; then
325 cp -fpPR ${WORKDIR}/temp-staging-pstage/${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ || /bin/true 302 mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/
326 cp -fpPR ${WORKDIR}/temp-staging-pstage/${STAGING_DIR}/* ${STAGING_DIR}/ || /bin/true 303 mkdir -p ${PSTAGE_TMPDIR_STAGE}/cross/
304 cp -fpPR ${SYSROOT_DESTDIR}/${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ || /bin/true
305 cp -fpPR ${SYSROOT_DESTDIR}/${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/ || /bin/true
306 fi
327} 307}
328 308
329do_populate_staging[dirs] =+ "${DEPLOY_DIR_PSTAGE}" 309do_populate_staging[dirs] =+ "${DEPLOY_DIR_PSTAGE}"
330python do_populate_staging_prepend() { 310python populate_staging_prehook() {
331 needstamp = bb.data.getVar("PSTAGING_NEEDSTAMP", d, 1) 311 bb.build.exec_func("populate_staging_preamble", d)
332 pstageactive = bb.data.getVar("PSTAGING_ACTIVE", d, True)
333 lock = bb.data.expand("${SYSROOT_LOCK}", d)
334 if needstamp == "1":
335 stamplock = bb.utils.lockfile(lock)
336 bb.build.exec_func("populate_staging_preamble", d)
337} 312}
338 313
339python do_populate_staging_append() { 314python populate_staging_posthook() {
340 if needstamp == "1": 315 bb.build.exec_func("populate_staging_postamble", d)
341 bb.build.exec_func("populate_staging_postamble", d)
342 bb.utils.unlockfile(stamplock)
343 elif pstageactive == "1":
344 stamplock = bb.utils.lockfile(lock)
345 bb.build.exec_func("autotools_staging_pstage", d)
346 bb.utils.unlockfile(stamplock)
347} 316}
348 317
349 318