mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
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>
This commit is contained in:
@@ -346,27 +346,18 @@ def sstate_clean(ss, d):
|
|||||||
CLEANFUNCS += "sstate_cleanall"
|
CLEANFUNCS += "sstate_cleanall"
|
||||||
|
|
||||||
python sstate_cleanall() {
|
python sstate_cleanall() {
|
||||||
import fnmatch
|
|
||||||
|
|
||||||
bb.note("Removing shared state for package %s" % d.getVar('PN', True))
|
bb.note("Removing shared state for package %s" % d.getVar('PN', True))
|
||||||
|
|
||||||
manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
|
manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
|
||||||
manifest_prefix = d.getVar("SSTATE_MANFILEPREFIX", True)
|
|
||||||
manifest_pattern = os.path.basename(manifest_prefix) + ".*"
|
|
||||||
|
|
||||||
if not os.path.exists(manifest_dir):
|
if not os.path.exists(manifest_dir):
|
||||||
return
|
return
|
||||||
|
|
||||||
for manifest in (os.listdir(manifest_dir)):
|
namemap = d.getVar('SSTATETASKNAMES', True).split()
|
||||||
if fnmatch.fnmatch(manifest, manifest_pattern):
|
tasks = d.getVar('SSTATETASKS', True).split()
|
||||||
name = manifest.replace(manifest_pattern[:-1], "")
|
for name in namemap:
|
||||||
namemap = d.getVar('SSTATETASKNAMES', True).split()
|
taskname = tasks[namemap.index(name)]
|
||||||
tasks = d.getVar('SSTATETASKS', True).split()
|
shared_state = sstate_state_fromvars(d, taskname[3:])
|
||||||
if name not in namemap:
|
sstate_clean(shared_state, d)
|
||||||
continue
|
|
||||||
taskname = tasks[namemap.index(name)]
|
|
||||||
shared_state = sstate_state_fromvars(d, taskname[3:])
|
|
||||||
sstate_clean(shared_state, d)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def sstate_hardcode_path(d):
|
def sstate_hardcode_path(d):
|
||||||
|
|||||||
Reference in New Issue
Block a user