summaryrefslogtreecommitdiff
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-10-22 10:22:34 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-22 10:22:34 +0100
commitfd4457199ef604dc4d5f8346c8b2a09dc3939129 (patch)
tree32234080a437751424a79bd170f62858c1527e13 /meta/classes/sstate.bbclass
parent2a69c58046a86d0f783acebd8a77e9419b43139a (diff)
downloadopenembedded-core-fd4457199ef604dc4d5f8346c8b2a09dc3939129.tar.gz
openembedded-core-fd4457199ef604dc4d5f8346c8b2a09dc3939129.tar.bz2
openembedded-core-fd4457199ef604dc4d5f8346c8b2a09dc3939129.zip
base/sstate: Add cleanall task to remove downloads and sstate cached files
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass21
1 files changed, 16 insertions, 5 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 4a63d37d20..92c3a274f0 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -44,11 +44,12 @@ def sstate_init(name, d):
ss['lockfiles'] = []
return ss
-def sstate_state_fromvars(d):
- task = bb.data.getVar('BB_CURRENTTASK', d, True)
- if not task:
- bb.fatal("sstate code running without task context?!")
- task = task.replace("_setscene", "")
+def sstate_state_fromvars(d, task = None):
+ if task is None:
+ task = bb.data.getVar('BB_CURRENTTASK', d, True)
+ if not task:
+ bb.fatal("sstate code running without task context?!")
+ task = task.replace("_setscene", "")
name = bb.data.expand(bb.data.getVarFlag("do_" + task, 'sstate-name', d), d)
inputs = (bb.data.expand(bb.data.getVarFlag("do_" + task, 'sstate-inputdirs', d) or "", d)).split()
@@ -158,6 +159,16 @@ def sstate_installpkg(ss, d):
return True
+def sstate_clean_cachefile(ss, d):
+ sstatepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_' + ss['name'] + ".tgz"
+ bb.note("Removing %s" % sstatepkg)
+ oe.path.remove(sstatepkg)
+
+def sstate_clean_cachefiles(d):
+ for task in (bb.data.getVar('SSTATETASKS', d, True) or "").split():
+ ss = sstate_state_fromvars(d, task[3:])
+ sstate_clean_cachefile(ss, d)
+
def sstate_clean_manifest(manifest, d):
import oe.path