if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
localdata.delVar('BB_NO_NETWORK')
- for task in range(len(sq_fn)):
- if task in ret:
- continue
-
- spec, extrapath, tname = getpathcomponents(task, d)
-
- sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + extension)
+ def checkstatus(arg):
+ (task, sstatefile) = arg
+ localdata2 = bb.data.createCopy(localdata)
srcuri = "file://" + sstatefile
localdata.setVar('SRC_URI', srcuri)
bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
try:
- fetcher = bb.fetch2.Fetch(srcuri.split(), localdata)
+ fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2)
fetcher.checkstatus()
bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
ret.append(task)
bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
pass
+ tasklist = []
+ for task in range(len(sq_fn)):
+ if task in ret:
+ continue
+ spec, extrapath, tname = getpathcomponents(task, d)
+ sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + extension)
+ tasklist.append((task, sstatefile))
+
+ if tasklist:
+ import multiprocessing
+ nproc = min(multiprocessing.cpu_count(), len(tasklist))
+ pool = oe.utils.ThreadedPool(nproc)
+ for t in tasklist:
+ pool.add_task(checkstatus, t)
+ pool.wait_completion()
+
inheritlist = d.getVar("INHERIT", True)
if "toaster" in inheritlist:
evdata = {'missed': [], 'found': []};