summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 14:30:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-16 09:49:32 +0100
commit41eb382737706e245f2b7104e313c8dfaa370945 (patch)
tree9f0d03e54e055803287517add726b9569a74b101 /meta/classes/sstate.bbclass
parent68e502e9063a88532fe0154f152ba408f0091900 (diff)
downloadopenembedded-core-41eb382737706e245f2b7104e313c8dfaa370945.tar.gz
sstate: Optimise SSTATE_EXCLUDEDEPS_SYSROOT handling
Using re.compile() is around six times faster than recompiling the regexp each time so maintain a cache. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass13
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6f2fa583f2..c0e54a398d 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -980,9 +980,16 @@ def setscene_depvalid(task, taskdependees, notneeded, d, log=None):
# them in.
# See also http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146324.html
not_needed = False
- for excl in (d.getVar('SSTATE_EXCLUDEDEPS_SYSROOT') or "").split():
- if re.match(excl.split('->', 1)[0], taskdependees[dep][0]):
- if re.match(excl.split('->', 1)[1], taskdependees[task][0]):
+ excludedeps = d.getVar('_SSTATE_EXCLUDEDEPS_SYSROOT')
+ if excludedeps is None:
+ # Cache the regular expressions for speed
+ excludedeps = []
+ for excl in (d.getVar('SSTATE_EXCLUDEDEPS_SYSROOT') or "").split():
+ excludedeps.append((re.compile(excl.split('->', 1)[0]), re.compile(excl.split('->', 1)[1])))
+ d.setVar('_SSTATE_EXCLUDEDEPS_SYSROOT', excludedeps)
+ for excl in excludedeps:
+ if excl[0].match(taskdependees[dep][0]):
+ if excl[1].match(taskdependees[task][0]):
not_needed = True
break
if not_needed: