diff options
| -rw-r--r-- | meta/classes/sstate.bbclass | 9 | ||||
| -rw-r--r-- | meta/classes/utility-tasks.bbclass | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 0aa8505f49..08c22293cc 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
| @@ -188,23 +188,24 @@ def sstate_clean(ss, d): | |||
| 188 | bb.utils.unlockfile(lock) | 188 | bb.utils.unlockfile(lock) |
| 189 | 189 | ||
| 190 | SCENEFUNCS += "sstate_cleanall" | 190 | SCENEFUNCS += "sstate_cleanall" |
| 191 | CLEANFUNCS += "sstate_cleanall" | ||
| 191 | 192 | ||
| 192 | python sstate_cleanall() { | 193 | python sstate_cleanall() { |
| 193 | import fnmatch | 194 | import fnmatch |
| 194 | 195 | ||
| 195 | bb.note("Removing %s from staging" % bb.data.getVar('PN', d, True)) | 196 | bb.note("Removing shared state for package %s" % bb.data.getVar('PN', d, True)) |
| 196 | 197 | ||
| 197 | manifest_dir = bb.data.getVar('PSTAGE2_MANIFESTS', d, True) | 198 | manifest_dir = bb.data.getVar('PSTAGE2_MANIFESTS', d, True) |
| 198 | manifest_pattern = bb.data.expand("manifest-${PN}.*", d) | 199 | manifest_pattern = bb.data.expand("manifest-${PN}.*", d) |
| 199 | 200 | ||
| 201 | if not os.path.exists(manifest_dir): | ||
| 202 | return | ||
| 203 | |||
| 200 | for manifest in (os.listdir(manifest_dir)): | 204 | for manifest in (os.listdir(manifest_dir)): |
| 201 | if fnmatch.fnmatch(manifest, manifest_pattern): | 205 | if fnmatch.fnmatch(manifest, manifest_pattern): |
| 202 | sstate_clean_manifest(manifest_dir + "/" + manifest, d) | 206 | sstate_clean_manifest(manifest_dir + "/" + manifest, d) |
| 203 | } | 207 | } |
| 204 | 208 | ||
| 205 | do_clean[postfuncs] += "sstate_cleanall" | ||
| 206 | do_clean[dirs] += "${PSTAGE2_MANIFESTS}" | ||
| 207 | |||
| 208 | def sstate_package(ss, d): | 209 | def sstate_package(ss, d): |
| 209 | import oe.path | 210 | import oe.path |
| 210 | 211 | ||
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass index 32333baf14..b3609965e7 100644 --- a/meta/classes/utility-tasks.bbclass +++ b/meta/classes/utility-tasks.bbclass | |||
| @@ -10,6 +10,8 @@ python do_listtasks() { | |||
| 10 | sys.__stdout__.write("%s\n" % e) | 10 | sys.__stdout__.write("%s\n" % e) |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | CLEANFUNCS ?= "" | ||
| 14 | |||
| 13 | addtask clean | 15 | addtask clean |
| 14 | do_clean[nostamp] = "1" | 16 | do_clean[nostamp] = "1" |
| 15 | python do_clean() { | 17 | python do_clean() { |
| @@ -21,6 +23,9 @@ python do_clean() { | |||
| 21 | dir = "%s.*" % bb.data.expand(bb.data.getVar('STAMP', d), d) | 23 | dir = "%s.*" % bb.data.expand(bb.data.getVar('STAMP', d), d) |
| 22 | bb.note("Removing " + dir) | 24 | bb.note("Removing " + dir) |
| 23 | oe.path.remove(dir) | 25 | oe.path.remove(dir) |
| 26 | |||
| 27 | for f in (bb.data.getVar('CLEANFUNCS', d, 1) or '').split(): | ||
| 28 | bb.build.exec_func(f, d) | ||
| 24 | } | 29 | } |
| 25 | 30 | ||
| 26 | addtask rebuild after do_${BB_DEFAULT_TASK} | 31 | addtask rebuild after do_${BB_DEFAULT_TASK} |
