[OE-core] [PATCH] sstate: Add eventhandler which cleans up stale recipe data

Christopher Larson clarson at kergoth.com
Tue Jun 9 02:36:23 UTC 2015


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?
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150608/94e4416a/attachment-0002.html>


More information about the Openembedded-core mailing list