summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-14 15:38:27 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-17 17:24:57 +0000
commitd46766ea5c122511e20f989bca8cb80e56a8b48d (patch)
tree8db26450db05cb04d11243ee330ed5743d49d2b7 /meta/classes/sstate.bbclass
parente651c1a109cb5d480e32354cdaa81f86032f71dd (diff)
downloadpoky-d46766ea5c122511e20f989bca8cb80e56a8b48d.tar.gz
sstate.bbclass: Simplify overcomplicated cleanall function
The code was written before SSTATETASKNAMES existed. Since it does exist, lets simply the code. (From OE-Core rev: 9817e2efdb94395655d711f5eadedcd249c8cffe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass21
1 files changed, 6 insertions, 15 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ec2c123b68..29f6b1c261 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -346,27 +346,18 @@ def sstate_clean(ss, d):
346CLEANFUNCS += "sstate_cleanall" 346CLEANFUNCS += "sstate_cleanall"
347 347
348python sstate_cleanall() { 348python sstate_cleanall() {
349 import fnmatch
350
351 bb.note("Removing shared state for package %s" % d.getVar('PN', True)) 349 bb.note("Removing shared state for package %s" % d.getVar('PN', True))
352 350
353 manifest_dir = d.getVar('SSTATE_MANIFESTS', True) 351 manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
354 manifest_prefix = d.getVar("SSTATE_MANFILEPREFIX", True)
355 manifest_pattern = os.path.basename(manifest_prefix) + ".*"
356
357 if not os.path.exists(manifest_dir): 352 if not os.path.exists(manifest_dir):
358 return 353 return
359 354
360 for manifest in (os.listdir(manifest_dir)): 355 namemap = d.getVar('SSTATETASKNAMES', True).split()
361 if fnmatch.fnmatch(manifest, manifest_pattern): 356 tasks = d.getVar('SSTATETASKS', True).split()
362 name = manifest.replace(manifest_pattern[:-1], "") 357 for name in namemap:
363 namemap = d.getVar('SSTATETASKNAMES', True).split() 358 taskname = tasks[namemap.index(name)]
364 tasks = d.getVar('SSTATETASKS', True).split() 359 shared_state = sstate_state_fromvars(d, taskname[3:])
365 if name not in namemap: 360 sstate_clean(shared_state, d)
366 continue
367 taskname = tasks[namemap.index(name)]
368 shared_state = sstate_state_fromvars(d, taskname[3:])
369 sstate_clean(shared_state, d)
370} 361}
371 362
372def sstate_hardcode_path(d): 363def sstate_hardcode_path(d):