summaryrefslogtreecommitdiff
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-04-27 10:48:16 +0000
committerRichard Purdie <richard@openedhand.com>2008-04-27 10:48:16 +0000
commit192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a (patch)
treeefc5abe7e8aa319d20012ee7235db4787313d0c7 /meta/classes/base.bbclass
parent04e667e2e1f495b8563a28a83d49b4bd0c493963 (diff)
downloadopenembedded-core-192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a.tar.gz
openembedded-core-192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a.tar.bz2
openembedded-core-192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a.zip
base.bbclass: Add setscene task to handle preparing the work area at the start of a given task, fixing the handling of the rebuild task. This task removes the need for do_prepackaged_stage in packaged-staging.bbclass.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4351 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass22
1 files changed, 20 insertions, 2 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 010b617721..b7459bc996 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -464,6 +464,24 @@ python base_do_mrproper() {
bb.build.exec_func('do_clean', d)
}
+SCENEFUNCS += "base_scenefunction"
+
+python base_do_setscene () {
+ for f in (bb.data.getVar('SCENEFUNCS', d, 1) or '').split():
+ bb.build.exec_func(f, d)
+ if not os.path.exists(bb.data.getVar('STAMP', d, 1) + ".do_setscene"):
+ bb.build.make_stamp("do_setscene", d)
+}
+do_setscene[selfstamp] = "1"
+addtask setscene before do_fetch
+
+python base_scenefunction () {
+ stamp = bb.data.getVar('STAMP', d, 1) + ".needclean"
+ if os.path.exists(stamp):
+ bb.build.exec_func("do_clean", d)
+}
+
+
addtask fetch
do_fetch[dirs] = "${DL_DIR}"
do_fetch[depends] = "shasum-native:do_populate_staging"
@@ -604,7 +622,6 @@ def oe_unpack_file(file, data, url = None):
return ret == 0
addtask unpack after do_fetch
-do_unpack[cleandirs] = "${WORKDIR}"
do_unpack[dirs] = "${WORKDIR}"
python base_do_unpack() {
import re, os
@@ -707,6 +724,7 @@ python base_eventhandler() {
dir = "%s.*" % e.stampPrefix[fn]
bb.note("Removing stamps: " + dir)
os.system('rm -f '+ dir)
+ os.system('touch ' + e.stampPrefix[fn] + '.needclean')
if not data in e.__dict__:
return NotHandled
@@ -972,7 +990,7 @@ inherit patch
# Move to autotools.bbclass?
inherit siteinfo
-EXPORT_FUNCTIONS do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall
+EXPORT_FUNCTIONS do_setscene do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall
MIRRORS[func] = "0"
MIRRORS () {