mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
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>
This commit is contained in:
@@ -980,9 +980,16 @@ def setscene_depvalid(task, taskdependees, notneeded, d, log=None):
|
|||||||
# them in.
|
# them in.
|
||||||
# See also http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146324.html
|
# See also http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146324.html
|
||||||
not_needed = False
|
not_needed = False
|
||||||
for excl in (d.getVar('SSTATE_EXCLUDEDEPS_SYSROOT') or "").split():
|
excludedeps = d.getVar('_SSTATE_EXCLUDEDEPS_SYSROOT')
|
||||||
if re.match(excl.split('->', 1)[0], taskdependees[dep][0]):
|
if excludedeps is None:
|
||||||
if re.match(excl.split('->', 1)[1], taskdependees[task][0]):
|
# 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
|
not_needed = True
|
||||||
break
|
break
|
||||||
if not_needed:
|
if not_needed:
|
||||||
|
|||||||
Reference in New Issue
Block a user