mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
bitbake: bitbake-diffsigs/runqueue: adapt to reworked find_siginfo()
In particular having 'time' explicitly used as a sorting key should make it more clear how the entries are being sorted. (Bitbake rev: 5439aca056c84ab4410aaf24bdb68e896191d8e1) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
a41b54ccbd
commit
cc85c8eb9d
@@ -72,13 +72,16 @@ def find_siginfo_task(bbhandler, pn, taskname, sig1=None, sig2=None):
|
|||||||
elif sig2 not in sigfiles:
|
elif sig2 not in sigfiles:
|
||||||
logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2))
|
logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
latestfiles = [sigfiles[sig1], sigfiles[sig2]]
|
|
||||||
else:
|
else:
|
||||||
filedates = find_siginfo(bbhandler, pn, taskname)
|
sigfiles = find_siginfo(bbhandler, pn, taskname)
|
||||||
latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-2:]
|
latestsigs = sorted(sigfiles.keys(), key=lambda h: sigfiles[h]['time'])[-2:]
|
||||||
if not latestfiles:
|
if not latestsigs:
|
||||||
logger.error('No sigdata files found matching %s %s' % (pn, taskname))
|
logger.error('No sigdata files found matching %s %s' % (pn, taskname))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
sig1 = latestsigs[0]
|
||||||
|
sig2 = latestsigs[1]
|
||||||
|
|
||||||
|
latestfiles = [sigfiles[sig1]['path'], sigfiles[sig2]['path']]
|
||||||
|
|
||||||
return latestfiles
|
return latestfiles
|
||||||
|
|
||||||
|
|||||||
@@ -1759,7 +1759,7 @@ class RunQueue:
|
|||||||
|
|
||||||
recout = []
|
recout = []
|
||||||
if len(hashfiles) == 2:
|
if len(hashfiles) == 2:
|
||||||
out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb)
|
out2 = bb.siggen.compare_sigfiles(hashfiles[hash1]['path'], hashfiles[hash2]['path'], recursecb)
|
||||||
recout.extend(list(' ' + l for l in out2))
|
recout.extend(list(' ' + l for l in out2))
|
||||||
else:
|
else:
|
||||||
recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
|
recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
|
||||||
@@ -1775,14 +1775,14 @@ class RunQueue:
|
|||||||
matches = bb.siggen.find_siginfo(pn, taskname, [], self.cooker.databuilder.mcdata[mc])
|
matches = bb.siggen.find_siginfo(pn, taskname, [], self.cooker.databuilder.mcdata[mc])
|
||||||
bb.debug(1, "Found hashfiles:\n{}".format(matches))
|
bb.debug(1, "Found hashfiles:\n{}".format(matches))
|
||||||
match = None
|
match = None
|
||||||
for m in matches:
|
for m in matches.values():
|
||||||
if h in m:
|
if h in m['path']:
|
||||||
match = m
|
match = m['path']
|
||||||
if match is None:
|
if match is None:
|
||||||
bb.fatal("Can't find a task we're supposed to have written out? (hash: %s tid: %s)?" % (h, tid))
|
bb.fatal("Can't find a task we're supposed to have written out? (hash: %s tid: %s)?" % (h, tid))
|
||||||
matches = {k : v for k, v in iter(matches.items()) if h not in k}
|
matches = {k : v for k, v in iter(matches.items()) if h not in k}
|
||||||
if matches:
|
if matches:
|
||||||
latestmatch = sorted(matches.keys(), key=lambda f: matches[f])[-1]
|
latestmatch = matches[sorted(matches.keys(), key=lambda h: matches[h]['time'])[-1]]['path']
|
||||||
prevh = __find_sha256__.search(latestmatch).group(0)
|
prevh = __find_sha256__.search(latestmatch).group(0)
|
||||||
output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
|
output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
|
||||||
bb.plain("\nTask %s:%s couldn't be used from the cache because:\n We need hash %s, most recent matching task was %s\n " % (pn, taskname, h, prevh) + '\n '.join(output))
|
bb.plain("\nTask %s:%s couldn't be used from the cache because:\n We need hash %s, most recent matching task was %s\n " % (pn, taskname, h, prevh) + '\n '.join(output))
|
||||||
|
|||||||
Reference in New Issue
Block a user