]> code.ossystems Code Review - openembedded-core.git/commitdiff
base.bbclass: Add setscene task to handle preparing the work area at the start of...
authorRichard Purdie <richard@openedhand.com>
Sun, 27 Apr 2008 10:48:16 +0000 (10:48 +0000)
committerRichard Purdie <richard@openedhand.com>
Sun, 27 Apr 2008 10:48:16 +0000 (10:48 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4351 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/classes/base.bbclass
meta/classes/packaged-staging.bbclass

index 010b61772167a36a60c4cc6c0a561540fb3f1abc..b7459bc9964ae3aa9d1c0cfaee1dc3252cb10bbe 100644 (file)
@@ -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 () {
index 1df2a2c9f07415ae892526975de9dcef7369ea67..e6f2f3b53ee05a089c8f0a1aaa9538f33bdf9811 100644 (file)
@@ -123,7 +123,9 @@ staging_helper () {
 
 PSTAGE_TASKS_COVERED = "fetch unpack munge patch configure qa_configure rig_locales compile sizecheck install deploy package populate_staging package_write_deb package_write_ipk package_write package_stage qa_staging"
 
-python do_prepackaged_stage () {
+SCENEFUNCS += "packagestage_scenefunc"
+
+python packagestage_scenefunc () {
     import os
 
     if bb.data.getVar("PSTAGING_ACTIVE", d, 1) == "0":
@@ -156,17 +158,10 @@ python do_prepackaged_stage () {
         if ret != 0:
             bb.note("Failure installing prestage package")
 
-        #bb.build.make_stamp("do_prepackaged_stage", d)
-        #for task in bb.data.getVar("PSTAGE_TASKS_COVERED", d, 1).split():
-        #    bb.build.make_stamp("do_" + task, d)
         bb.build.make_stamp("do_stage_package_populated", d)
 
-    else:
-        bb.build.make_stamp("do_prepackaged_stage", d)
 }
-do_prepackaged_stage[cleandirs] = "${PSTAGE_TMPDIR_STAGE}"
-do_prepackaged_stage[selfstamp] = "1"
-addtask prepackaged_stage before do_fetch
+packagestage_scenefunc[cleandirs] = "${PSTAGE_TMPDIR_STAGE}"
 
 addhandler packagedstage_stampfixing_eventhandler
 python packagedstage_stampfixing_eventhandler() {