diff options
author | Liping Ke <liping.ke@intel.com> | 2011-06-03 08:21:44 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-07 22:37:10 +0100 |
commit | d50389ae692377c957afec7c846fc2ce2c070a09 (patch) | |
tree | d82699d040d40ecf5f721acf1dc1d475173aa2e6 /lib/bb/cache.py | |
parent | 75d9add923560af9fdd772a363c68337d2c9a97d (diff) | |
download | bitbake-d50389ae692377c957afec7c846fc2ce2c070a09.tar.gz |
cache: Introduce new param caches_array into Cache impl.
When using hob ui interface, we need extra cache fields.
We will save ui required extra cache fields into a separate
cache file. This patch introduce this caches_array parameter.
It will be used in the extra cache implementation (following patch).
Caches_array at least contains CoreRecipeInfo. If users need extra
cache fields support, such as 'hob', caches_array will contain
more relevant elements such as HobRecipeInfo.
Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cache.py')
-rw-r--r-- | lib/bb/cache.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py index 09691d98c..0620621d0 100644 --- a/lib/bb/cache.py +++ b/lib/bb/cache.py @@ -245,7 +245,11 @@ class Cache(object): BitBake Cache implementation """ - def __init__(self, data): + def __init__(self, data, caches_array): + # Pass caches_array information into Cache Constructor + # It will be used in later for deciding whether we + # need extra cache file dump/load support + self.caches_array = caches_array self.cachedir = bb.data.getVar("CACHE", data, True) self.clean = set() self.checked = set() @@ -360,7 +364,7 @@ class Cache(object): return bb_data[virtual] @classmethod - def parse(cls, filename, appends, configdata): + def parse(cls, filename, appends, configdata, caches_array): """Parse the specified filename, returning the recipe information""" infos = [] datastores = cls.load_bbfile(filename, appends, configdata) @@ -393,7 +397,7 @@ class Cache(object): infos.append((virtualfn, self.depends_cache[virtualfn])) else: logger.debug(1, "Parsing %s", filename) - return self.parse(filename, appends, configdata) + return self.parse(filename, appends, configdata, self.caches_array) return cached, infos @@ -623,8 +627,9 @@ class CacheData(object): The data structures we compile from the cached data """ - def __init__(self): - CoreRecipeInfo.init_cacheData(self) + def __init__(self, caches_array): + self.caches_array = caches_array + CoreRecipeInfo.init_cacheData(self) # Direct cache variables self.task_queues = {} self.preferred = {} |