[bitbake-devel] [PATCH] cache: Split Cache() into a NoCache() parent object

Christopher Larson clarson at kergoth.com
Mon Aug 15 17:20:51 UTC 2016


On Mon, Aug 15, 2016 at 10:02 AM, Richard Purdie <
richard.purdie at linuxfoundation.org> wrote:

> There are some cases we want to parse recipes without any cache
> setup or involvement. Split out the standalone functions into
> a NoCache variant which the Cache is based upon, setting the scene
> for further cleanup and restructuring.
>
> Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
>
> diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
> index 7118c83..8c1fe11 100644
> --- a/bitbake/lib/bb/cache.py
> +++ b/bitbake/lib/bb/cache.py
> @@ -265,12 +265,68 @@ def realfn2virtual(realfn, cls):
>          return realfn
>      return "virtual:" + cls + ":" + realfn
>
> -class Cache(object):
> +class NoCache(object):
> +
> +    def __init__(self, databuilder):
> +        self.databuilder = databuilder
> +        self.data = databuilder.data
>

I like the idea, but do we really need to pass in databuilder and set data
if this class makes no use of it? It's all class methods, after all.
-- 
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/bitbake-devel/attachments/20160815/5b780617/attachment-0002.html>


More information about the bitbake-devel mailing list