]> code.ossystems Code Review - openembedded-core.git/commitdiff
sstate: ensure an ordered mapping between SSTATETASKS and SSTATETASKNAMES
authorDexuan Cui <dexuan.cui@intel.com>
Thu, 7 Apr 2011 09:38:17 +0000 (17:38 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 8 Apr 2011 13:06:39 +0000 (06:06 -0700)
Fix [YOCTO #964]

A recent commit 25a6e5f9(sstate: use only unique set of SSTATETASK) breaks
the ordered mapping between SSTATETASKS and SSTATETASKNAMES. As a result,
in sstate_cleanall, the line
taskname = tasks[namemap.index(name)]
gets an incorrect result, and "bitbake -c cleanall" doesn't really remove
the files populalted by do_populate_sysroot.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
meta/classes/sstate.bbclass

index cc0b8665f6b09f5dfbd0b3f9186e745c76fe0917..be650c4af4d7f0e69b97a77f8fb68c9eb6ac918f 100644 (file)
@@ -39,8 +39,10 @@ python () {
         scan_cmd = "grep -Irl ${STAGING_DIR} ${SSTATE_BUILDDIR}"
         bb.data.setVar('SSTATE_SCAN_CMD', scan_cmd, d)
 
+    unique_tasks = set((bb.data.getVar('SSTATETASKS', d, True) or "").split())
+    d.setVar('SSTATETASKS', " ".join(unique_tasks))
     namemap = []
-    for task in set((bb.data.getVar('SSTATETASKS', d, True) or "").split()):
+    for task in unique_tasks:
         namemap.append(bb.data.getVarFlag(task, 'sstate-name', d))
         funcs = bb.data.getVarFlag(task, 'prefuncs', d) or ""
         funcs = "sstate_task_prefunc " + funcs
@@ -200,7 +202,7 @@ def sstate_clean_cachefile(ss, d):
     oe.path.remove(sstatepkgfile)
 
 def sstate_clean_cachefiles(d):
-    for task in set((bb.data.getVar('SSTATETASKS', d, True) or "").split()):
+    for task in (bb.data.getVar('SSTATETASKS', d, True) or "").split():
         ss = sstate_state_fromvars(d, task[3:])
         sstate_clean_cachefile(ss, d)