fix: keep two cores' revisions of a name apart

The truth model merged a pathless entry into another core's entry of
the same name even when their contents disagreed, so the export wrote
one core's size next to the other core's md5.
This commit is contained in:
Abdessamad Derraz committed 2026-10-17 11:52:40 +02:00
1 parent 5a01a45d6b
commit 5f62597e6f
2 files changed
+23 -4

No files matched your search

+10 -2
View File
@@ -174,8 +174,16 @@ def _same_file(files: list[dict], file_entry: dict, emu_name: str) -> dict | Non
if emu_name not in f.get("_cores", ()) and not _contents_disagree(f, file_entry)),
None,
)
# Revisions accepted under one name and no path fill one slot.
or next((f for f in same_name if not path or not other_path(f)), None)
# Revisions one core accepts under one name and no path fill one
# slot. Across cores, contents that disagree are two files: fMSX's
# 16640-byte RS232.ROM took blueMSX's 8192 size beside its own md5,
# a record no file satisfies.
or next(
(f for f in same_name
if (not path or not other_path(f))
and (emu_name in f.get("_cores", ()) or not _contents_disagree(f, file_entry))),
None,
)
)