diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-22 10:22:34 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-22 10:22:34 +0100 |
commit | fd4457199ef604dc4d5f8346c8b2a09dc3939129 (patch) | |
tree | 32234080a437751424a79bd170f62858c1527e13 /meta/classes/sstate.bbclass | |
parent | 2a69c58046a86d0f783acebd8a77e9419b43139a (diff) | |
download | poky-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.bbclass | 21 |
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 | ||
47 | def sstate_state_fromvars(d): | 47 | def 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 | ||
162 | def 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 | |||
167 | def 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 | |||
161 | def sstate_clean_manifest(manifest, d): | 172 | def sstate_clean_manifest(manifest, d): |
162 | import oe.path | 173 | import oe.path |
163 | 174 | ||