[OE-core] [PATCH] sstate: Add eventhandler which cleans up stale recipe data
Richard Purdie
richard.purdie at linuxfoundation.org
Tue Jun 9 07:34:42 UTC 2015
On Mon, 2015-06-08 at 21:36 -0500, Christopher Larson wrote:
> On Mon, Jun 8, 2015 at 5:28 PM, Richard Purdie
> <richard.purdie at linuxfoundation.org> wrote:
> + for a in d.getVar("SSTATE_ARCHS", True).split():
> + toremove = []
> + i = d.expand("${SSTATE_MANIFESTS}/index-" + a)
> + if not os.path.exists(i):
> + continue
> + with open(i, "r") as f:
> + lines = f.readlines()
> + for l in lines:
> + (stamp, manifest, workdir) = l.split()
> + if stamp not in stamps:
> + toremove.append(l)
> + if stamp not in seen:
> + bb.note("Stamp %s is not reachable,
> removing related manifests" % stamp)
> + seen.append(stamp)
> + for r in toremove:
> + (stamp, manifest, workdir) = r.split()
> + for m in glob.glob(manifest + ".*"):
> + sstate_clean_manifest(m, d)
> + bb.utils.remove(stamp + "*")
> + if removeworkdir:
> + bb.utils.remove(workdir, recurse = True)
>
> This looks like it’ll solve a lot of headaches for folks.
>
> Should the removal of workdir bit be outside the ‘for r in toremove’
> block?
I don't think so since each item in toremove may have a different
workdir?
Cheers,
Richard
More information about the Openembedded-core
mailing list