if not cachefile:
return
+ lf = bb.utils.lockfile(cachefile + ".lock")
+
+ p = pickle.Unpickler(file(cachefile, "rb"))
+ data, version = p.load()
+
+ if version == PARSERCACHE_VERSION:
+ for h in data[0]:
+ if h not in pythonparsecache:
+ pythonparsecache[h] = data[0][h]
+ for h in data[1]:
+ if h not in pythonparsecache:
+ shellparsecache[h] = data[1][h]
+
p = pickle.Pickler(file(cachefile, "wb"), -1)
p.dump([[pythonparsecache, shellparsecache], PARSERCACHE_VERSION])
+ bb.utils.unlockfile(lf)
class PythonParser():
class ValueVisitor():
def start(self):
def init(cfg):
parse_file.cfg = cfg
+ multiprocessing.util.Finalize(None, bb.codeparser.parser_cache_save, args=(self.cooker.configuration.data, ), exitpriority=1)
self.results = self.load_cached()