1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

bitbake: siggen: Fix sorting in diff output

The diff output isn't deterministic at the moment as the sets can have differing
ordering. Sort the output so it is consistent.

(Bitbake rev: 117830c1d7ef3e53052fa326e1ca62c5c3946c45)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2021-09-24 15:55:30 +01:00
parent eab1c2087f
commit 72e03d8a91
+7 -7
View File
@@ -864,21 +864,21 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
changed, added, removed = dict_diff(a_data['gendeps'], b_data['gendeps'], a_data['basewhitelist'] & b_data['basewhitelist']) changed, added, removed = dict_diff(a_data['gendeps'], b_data['gendeps'], a_data['basewhitelist'] & b_data['basewhitelist'])
if changed: if changed:
for dep in changed: for dep in sorted(changed):
output.append(color_format("{color_title}List of dependencies for variable %s changed from '{color_default}%s{color_title}' to '{color_default}%s{color_title}'") % (dep, a_data['gendeps'][dep], b_data['gendeps'][dep])) output.append(color_format("{color_title}List of dependencies for variable %s changed from '{color_default}%s{color_title}' to '{color_default}%s{color_title}'") % (dep, a_data['gendeps'][dep], b_data['gendeps'][dep]))
if a_data['gendeps'][dep] and b_data['gendeps'][dep]: if a_data['gendeps'][dep] and b_data['gendeps'][dep]:
output.append("changed items: %s" % a_data['gendeps'][dep].symmetric_difference(b_data['gendeps'][dep])) output.append("changed items: %s" % a_data['gendeps'][dep].symmetric_difference(b_data['gendeps'][dep]))
if added: if added:
for dep in added: for dep in sorted(added):
output.append(color_format("{color_title}Dependency on variable %s was added") % (dep)) output.append(color_format("{color_title}Dependency on variable %s was added") % (dep))
if removed: if removed:
for dep in removed: for dep in sorted(removed):
output.append(color_format("{color_title}Dependency on Variable %s was removed") % (dep)) output.append(color_format("{color_title}Dependency on Variable %s was removed") % (dep))
changed, added, removed = dict_diff(a_data['varvals'], b_data['varvals']) changed, added, removed = dict_diff(a_data['varvals'], b_data['varvals'])
if changed: if changed:
for dep in changed: for dep in sorted(changed):
oldval = a_data['varvals'][dep] oldval = a_data['varvals'][dep]
newval = b_data['varvals'][dep] newval = b_data['varvals'][dep]
if newval and oldval and ('\n' in oldval or '\n' in newval): if newval and oldval and ('\n' in oldval or '\n' in newval):
@@ -948,7 +948,7 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
b = b_data['runtaskhashes'] b = b_data['runtaskhashes']
changed, added, removed = dict_diff(a, b) changed, added, removed = dict_diff(a, b)
if added: if added:
for dep in added: for dep in sorted(added):
bdep_found = False bdep_found = False
if removed: if removed:
for bdep in removed: for bdep in removed:
@@ -958,7 +958,7 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
if not bdep_found: if not bdep_found:
output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (clean_basepath(dep), b[dep])) output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (clean_basepath(dep), b[dep]))
if removed: if removed:
for dep in removed: for dep in sorted(removed):
adep_found = False adep_found = False
if added: if added:
for adep in added: for adep in added:
@@ -968,7 +968,7 @@ def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
if not adep_found: if not adep_found:
output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (clean_basepath(dep), a[dep])) output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (clean_basepath(dep), a[dep]))
if changed: if changed:
for dep in changed: for dep in sorted(changed):
if not collapsed: if not collapsed:
output.append(color_format("{color_title}Hash for dependent task %s changed{color_default} from %s to %s") % (clean_basepath(dep), a[dep], b[dep])) output.append(color_format("{color_title}Hash for dependent task %s changed{color_default} from %s to %s") % (clean_basepath(dep), a[dep], b[dep]))
if callable(recursecb): if callable(recursecb):