summaryrefslogtreecommitdiffstats
path: root/meta
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:39 +0100
commit59acf118fc0374a9744abb9dd49b8e8aecc142eb (patch)
tree5fbb452fe829e0a29cb419b3de13bb2ce7868f3e /meta
parent6e362580a667de3a5ba98e877e561ecd5cea7137 (diff)
downloadpoky-59acf118fc0374a9744abb9dd49b8e8aecc142eb.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. (From OE-Core rev: 41eb382737706e245f2b7104e313c8dfaa370945) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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):
980 # them in. 980 # them in.
981 # See also http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146324.html 981 # See also http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146324.html
982 not_needed = False 982 not_needed = False
983 for excl in (d.getVar('SSTATE_EXCLUDEDEPS_SYSROOT') or "").split(): 983 excludedeps = d.getVar('_SSTATE_EXCLUDEDEPS_SYSROOT')
984 if re.match(excl.split('->', 1)[0], taskdependees[dep][0]): 984 if excludedeps is None:
985 if re.match(excl.split('->', 1)[1], taskdependees[task][0]): 985 # Cache the regular expressions for speed
986 excludedeps = []
987 for excl in (d.getVar('SSTATE_EXCLUDEDEPS_SYSROOT') or "").split():
988 excludedeps.append((re.compile(excl.split('->', 1)[0]), re.compile(excl.split('->', 1)[1])))
989 d.setVar('_SSTATE_EXCLUDEDEPS_SYSROOT', excludedeps)
990 for excl in excludedeps:
991 if excl[0].match(taskdependees[dep][0]):
992 if excl[1].match(taskdependees[task][0]):
986 not_needed = True 993 not_needed = True
987 break 994 break
988 if not_needed: 995 if not_needed: