summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2006-04-15 23:18:07 +0000
committerHolger Hans Peter Freyther <zecke@selfish.org>2006-04-15 23:18:07 +0000
commit40d07e863a1fb8a747f9efb1d483b5ac50ca449f (patch)
treecaf3ac984352eee043038eda97c37be62532288f
parent17ecb65b392e98860661502015759782b55028a7 (diff)
downloadbitbake-40d07e863a1fb8a747f9efb1d483b5ac50ca449f.tar.gz
bitbake/lib/bb/data.py:
-Remove the 'Proxies' for the pkgdata Cache -Remove the pkgdata() method as we now have a different caching strategy -Alter init_db to only take a parent and call createCopy directly bitbake/lib/bb/data_smart.py: -Remove the DataSmartPackage class as it is not needed bitbake/lib/bb/cache.py: -Call init_db with the only reasonable argument
-rw-r--r--lib/bb/cache.py2
-rw-r--r--lib/bb/data.py80
-rw-r--r--lib/bb/data_smart.py29
3 files changed, 6 insertions, 105 deletions
diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index e5c5c8ef7..de4c8489a 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -195,7 +195,7 @@ class Cache:
# go there
oldpath = os.path.abspath(os.getcwd())
os.chdir(topdir)
- bb_data = data.init_db(self.cachedir,bbfile, True, cooker.configuration.data)
+ bb_data = data.init_db(cooker.configuration.data)
try:
parse.handle(bbfile, bb_data) # read .bb data
os.chdir(oldpath)
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 1c1eefe9d..55d1cc905 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -48,85 +48,15 @@ sys.path.insert(0,path)
from bb import note, debug, data_smart
_dict_type = data_smart.DataSmart
-_dict_p_type = data_smart.DataSmartPackage
-
-class DataDictFull(dict):
- """
- This implements our Package Data Storage Interface.
- setDirty is a no op as all items are held in memory
- """
- def setDirty(self, bbfile, data):
- """
- No-Op we assume data was manipulated as some sort of
- reference
- """
- if not bbfile in self:
- raise Exception("File %s was not in dictionary before" % bbfile)
-
- self[bbfile] = data
-
-class DataDictCache:
- """
- Databacked Dictionary implementation
- """
- def __init__(self, cache_dir, config):
- self.cache_dir = cache_dir
- self.files = []
- self.dirty = {}
- self.config = config
-
- def has_key(self,key):
- return key in self.files
-
- def keys(self):
- return self.files
-
- def __setitem__(self, key, data):
- """
- Add the key to the list of known files and
- place the data in the cache?
- """
- if key in self.files:
- return
-
- self.files.append(key)
-
- def __getitem__(self, key):
- if not key in self.files:
- return None
-
- # if it was dirty we will
- if key in self.dirty:
- return self.dirty[key]
-
- # not cached yet
- return _dict_p_type(self.cache_dir, key,False,self.config)
-
- def setDirty(self, bbfile, data):
- """
- Only already added items can be declared dirty!!!
- """
-
- if not bbfile in self.files:
- raise Exception("File %s was not in dictionary before" % bbfile)
-
- self.dirty[bbfile] = data
-
-
def init():
return _dict_type()
-def init_db(cache,name,clean,parent = None):
- return _dict_p_type(cache,name,clean,parent)
-
-def pkgdata(use_cache, cache, config = None):
- """
- Return some sort of dictionary to lookup parsed dictionaires
- """
- if use_cache:
- return DataDictCache(cache, config)
- return DataDictFull()
+def init_db(parent = None):
+ if parent:
+ return parent.createCopy()
+ else:
+ return _dict_type()
def createCopy(source):
"""Link the source set to the destination
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index ca1e3a246..c29ab59b6 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -270,32 +270,3 @@ class DataSmart:
self.dict[var] = data
-class DataSmartPackage(DataSmart):
- """
- Persistent Data Storage
- """
- def linkDataSet(self):
- if not self.parent == None:
- # assume parent is a DataSmartInstance
- self.dict["_data"] = self.parent.dict
-
-
- def __init__(self,cache,name,clean,parent):
- """
- Construct a persistent data instance
- """
- #Initialize the dictionary
- DataSmart.__init__(self)
-
- self.cache = cache
- self.bbfile = os.path.abspath( name )
- self.parent = parent
-
-
-
- # XXX Kill this class, kill this deepcopy by COW
- self._seen_overrides = copy.deepcopy(parent._seen_overrides)
- self._special_values = copy.deepcopy(parent._special_values)
-
- self.linkDataSet()
-