]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate/utility-tasks: Ensure do_clean functions correctly and removes shared state
authorRichard Purdie <rpurdie@linux.intel.com>
Fri, 27 Aug 2010 11:33:58 +0000 (12:33 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 27 Aug 2010 11:33:58 +0000 (12:33 +0100)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
meta/classes/sstate.bbclass
meta/classes/utility-tasks.bbclass

index 0aa8505f49b664203d83fcbb617cd9f302499e30..08c22293ccce74c40e9456489e79d29433494978 100644 (file)
@@ -188,23 +188,24 @@ def sstate_clean(ss, d):
         bb.utils.unlockfile(lock)
 
 SCENEFUNCS += "sstate_cleanall"
+CLEANFUNCS += "sstate_cleanall"
 
 python sstate_cleanall() {
     import fnmatch
 
-    bb.note("Removing %s from staging" % bb.data.getVar('PN', d, True))
+    bb.note("Removing shared state for package %s" % bb.data.getVar('PN', d, True))
 
     manifest_dir = bb.data.getVar('PSTAGE2_MANIFESTS', d, True)
     manifest_pattern = bb.data.expand("manifest-${PN}.*", d)
 
+    if not os.path.exists(manifest_dir):
+        return
+
     for manifest in (os.listdir(manifest_dir)):
         if fnmatch.fnmatch(manifest, manifest_pattern):
              sstate_clean_manifest(manifest_dir + "/" + manifest, d)
 }
 
-do_clean[postfuncs] += "sstate_cleanall"
-do_clean[dirs] += "${PSTAGE2_MANIFESTS}"
-
 def sstate_package(ss, d):
     import oe.path
 
index 32333baf141ae248b8875c5a1f8985905a3a7a05..b3609965e72c6787e4f9d39db4fc34fa679c6fa2 100644 (file)
@@ -10,6 +10,8 @@ python do_listtasks() {
                        sys.__stdout__.write("%s\n" % e)
 }
 
+CLEANFUNCS ?= ""
+
 addtask clean
 do_clean[nostamp] = "1"
 python do_clean() {
@@ -21,6 +23,9 @@ python do_clean() {
        dir = "%s.*" % bb.data.expand(bb.data.getVar('STAMP', d), d)
        bb.note("Removing " + dir)
        oe.path.remove(dir)
+
+       for f in (bb.data.getVar('CLEANFUNCS', d, 1) or '').split():
+               bb.build.exec_func(f, d)
 }
 
 addtask rebuild after do_${BB_DEFAULT_TASK}