summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/codeparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
-rw-r--r--bitbake/lib/bb/codeparser.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 84d1c09f21..fdba06f678 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -70,8 +70,22 @@ def parser_cache_save(d):
70 if not cachefile: 70 if not cachefile:
71 return 71 return
72 72
73 lf = bb.utils.lockfile(cachefile + ".lock")
74
75 p = pickle.Unpickler(file(cachefile, "rb"))
76 data, version = p.load()
77
78 if version == PARSERCACHE_VERSION:
79 for h in data[0]:
80 if h not in pythonparsecache:
81 pythonparsecache[h] = data[0][h]
82 for h in data[1]:
83 if h not in pythonparsecache:
84 shellparsecache[h] = data[1][h]
85
73 p = pickle.Pickler(file(cachefile, "wb"), -1) 86 p = pickle.Pickler(file(cachefile, "wb"), -1)
74 p.dump([[pythonparsecache, shellparsecache], PARSERCACHE_VERSION]) 87 p.dump([[pythonparsecache, shellparsecache], PARSERCACHE_VERSION])
88 bb.utils.unlockfile(lf)
75 89
76class PythonParser(): 90class PythonParser():
77 class ValueVisitor(): 91 class ValueVisitor():