[oe-commits] unknown Updated to SVN revision 308
rwhitby commit
openembedded-commits at lists.openembedded.org
Mon Oct 23 17:47:11 UTC 2006
Updated to SVN revision 308
Author: rwhitby at nslu2-linux.org
Branch: unknown
Revision: a68af4ca64b874bdf471eab48b34780515b524f9
ViewMTN: http://monotone.openembedded.org/revision.psp?id=a68af4ca64b874bdf471eab48b34780515b524f9
Files:
1
bin/bitbake
lib/bb/data.py
lib/bb/data_smart.py
lib/bb/parse/parse_py/BBHandler.py
Diffs:
#
# mt diff -r8b18357f2e44db6d7a19b4c930bd3d8f04b20085 -ra68af4ca64b874bdf471eab48b34780515b524f9
#
#
#
# patch "bin/bitbake"
# from [3a0a7eaeb57f757d47e14765ca36ac8e4bd46699]
# to [ffb1a3669f82555a2af65184d1ec54a9bbfb12df]
#
# patch "lib/bb/data.py"
# from [ecbed5376e7a5a66cd5406ebc8570ed97a1ac500]
# to [4e6be430a7f7d1930b7625768f83e21bf7c8bed7]
#
# patch "lib/bb/data_smart.py"
# from [956c8ebc2025f89c58097acb459798031dc05e35]
# to [feca560c9dc08b07863d31fdce85695387887261]
#
# patch "lib/bb/parse/parse_py/BBHandler.py"
# from [29109b6d0529528c89b2fc1130ac80a4ddd6e130]
# to [179e10e72edeb29678517e27488885b3ca7d4912]
#
============================================================
--- bin/bitbake 3a0a7eaeb57f757d47e14765ca36ac8e4bd46699
+++ bin/bitbake ffb1a3669f82555a2af65184d1ec54a9bbfb12df
@@ -785,7 +785,7 @@ class BBCooker:
self.cb = progressCallback
parsed, cached, skipped, masked = 0, 0, 0, 0
self.cache = bb.data.getVar( "CACHE", self.configuration.data, 1 )
- self.pkgdata = data.pkgdata( not self.cache in [None, ''], self.cache )
+ self.pkgdata = data.pkgdata( not self.cache in [None, ''], self.cache, self.configuration.data )
if not self.cache in [None, '']:
if self.cb is not None:
============================================================
--- lib/bb/data.py ecbed5376e7a5a66cd5406ebc8570ed97a1ac500
+++ lib/bb/data.py 4e6be430a7f7d1930b7625768f83e21bf7c8bed7
@@ -57,10 +57,11 @@ class DataDictCache:
"""
Databacked Dictionary implementation
"""
- def __init__(self, cache_dir):
+ 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
@@ -87,7 +88,7 @@ class DataDictCache:
return self.dirty[key]
# not cached yet
- return _dict_p_type(self.cache_dir, key,False,None)
+ return _dict_p_type(self.cache_dir, key,False,self.config)
def setDirty(self, bbfile, data):
"""
@@ -110,12 +111,12 @@ def init_db_mtime(cache,cache_bbfile):
def init_db_mtime(cache,cache_bbfile):
return _dict_p_type.mtime(cache,cache_bbfile)
-def pkgdata(use_cache, cache):
+def pkgdata(use_cache, cache, config = None):
"""
Return some sort of dictionary to lookup parsed dictionaires
"""
if use_cache:
- return DataDictCache(cache)
+ return DataDictCache(cache, config)
return DataDictFull()
def createCopy(source):
============================================================
--- lib/bb/data_smart.py 956c8ebc2025f89c58097acb459798031dc05e35
+++ lib/bb/data_smart.py feca560c9dc08b07863d31fdce85695387887261
@@ -284,15 +284,16 @@ class DataSmartPackage(DataSmart):
cache_bbfile = self.sanitize_filename(self.bbfile)
p = pickle.Unpickler( file("%s/%s"%(self.cache,cache_bbfile),"rb"))
self.dict = p.load()
+ self.unpickle_prep()
funcstr = self.getVar('__functions__', 0)
if funcstr:
comp = compile(funcstr, "<pickled>", "exec")
exec comp in __builtins__
- def linkDataSet(self,parent):
- if not parent == None:
+ def linkDataSet(self):
+ if not self.parent == None:
# assume parent is a DataSmartInstance
- self.dict = copy.deepcopy(parent.dict)
+ self.dict["_data"] = self.parent.dict
def __init__(self,cache,name,clean,parent):
@@ -304,10 +305,11 @@ class DataSmartPackage(DataSmart):
self.cache = cache
self.bbfile = os.path.abspath( name )
+ self.parent = parent
# Either unpickle the data or do copy on write
if clean:
- self.linkDataSet(parent)
+ self.linkDataSet()
else:
self.unpickle()
@@ -315,10 +317,14 @@ class DataSmartPackage(DataSmart):
"""
Save the package to a permanent storage
"""
+ self.pickle_prep()
+
cache_bbfile = self.sanitize_filename(self.bbfile)
p = pickle.Pickler(file("%s/%s" %(self.cache,cache_bbfile), "wb" ), -1 )
p.dump( self.dict )
+ self.unpickle_prep()
+
def mtime(cache,bbfile):
cache_bbfile = DataSmartPackage.sanitize_filename(bbfile)
try:
@@ -326,3 +332,20 @@ class DataSmartPackage(DataSmart):
except OSError:
return 0
mtime = staticmethod(mtime)
+
+ def pickle_prep(self):
+ """
+ If self.dict contains a _data key and it is a configuration
+ we will remember we had a configuration instance attached
+ """
+ if "_data" in self.dict:
+ if self.dict["_data"] == self.parent:
+ dest["_data"] = "cfg"
+
+ def unpickle_prep(self):
+ """
+ If we had a configuration instance attached, we will reattach it
+ """
+ if "_data" in self.dict:
+ if self.dict["_data"] == "cfg":
+ self.dict["_data"] = self.parent
============================================================
--- lib/bb/parse/parse_py/BBHandler.py 29109b6d0529528c89b2fc1130ac80a4ddd6e130
+++ lib/bb/parse/parse_py/BBHandler.py 179e10e72edeb29678517e27488885b3ca7d4912
@@ -28,7 +28,7 @@ from bb.parse import ParseError
from ConfHandler import include, localpath, obtain, init
from bb.parse import ParseError
-__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
+__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
__inherit_regexp__ = re.compile( r"inherit\s+(.+)" )
__export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" )
__addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
More information about the Openembedded-commits
mailing list