summaryrefslogtreecommitdiffstats
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)
downloadpoky-fd4457199ef604dc4d5f8346c8b2a09dc3939129.tar.gz
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):
44 ss['lockfiles'] = [] 44 ss['lockfiles'] = []
45 return ss 45 return ss
46 46
47def sstate_state_fromvars(d): 47def sstate_state_fromvars(d, task = None):
48 task = bb.data.getVar('BB_CURRENTTASK', d, True) 48 if task is None:
49 if not task: 49 task = bb.data.getVar('BB_CURRENTTASK', d, True)
50 bb.fatal("sstate code running without task context?!") 50 if not task:
51 task = task.replace("_setscene", "") 51 bb.fatal("sstate code running without task context?!")
52 task = task.replace("_setscene", "")
52 53
53 name = bb.data.expand(bb.data.getVarFlag("do_" + task, 'sstate-name', d), d) 54 name = bb.data.expand(bb.data.getVarFlag("do_" + task, 'sstate-name', d), d)
54 inputs = (bb.data.expand(bb.data.getVarFlag("do_" + task, 'sstate-inputdirs', d) or "", d)).split() 55 inputs = (bb.data.expand(bb.data.getVarFlag("do_" + task, 'sstate-inputdirs', d) or "", d)).split()
@@ -158,6 +159,16 @@ def sstate_installpkg(ss, d):
158 159
159 return True 160 return True
160 161
162def sstate_clean_cachefile(ss, d):
163 sstatepkg = bb.data.getVar('SSTATE_PKG', d, True) + '_' + ss['name'] + ".tgz"
164 bb.note("Removing %s" % sstatepkg)
165 oe.path.remove(sstatepkg)
166
167def sstate_clean_cachefiles(d):
168 for task in (bb.data.getVar('SSTATETASKS', d, True) or "").split():
169 ss = sstate_state_fromvars(d, task[3:])
170 sstate_clean_cachefile(ss, d)
171
161def sstate_clean_manifest(manifest, d): 172def sstate_clean_manifest(manifest, d):
162 import oe.path 173 import oe.path
163 174