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

Richard Purdie richard.purdie at linuxfoundation.org
Mon Aug 15 20:28:14 UTC 2016


On Mon, 2016-08-15 at 10:20 -0700, Christopher Larson wrote:
> 
> 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.

If I remember correctly it is used by users of the class, e.g. in
bitbake-worker so this is setting things up for later changes.

data is set since we have a ton of code which knows about this
namespace and I didn't really want to go and patch it all right now.

Cheers,

Richard






More information about the bitbake-devel mailing list