fix: print the declared CRC32 on platform pages

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 17:19:58 +02:00
1 parent d5dd16dbdb
commit bfc7101166
2 files changed
+19 -2

No files matched your search

+7 -2
View File
@@ -1622,13 +1622,18 @@ def _render_platform_systems(
destination = str(cfg_entry.get("destination") or "")
where = f" at `{destination}`" if destination and destination != fname else ""
lines.append(f"{pad}- `{fname}`{where} - {', '.join(details)}")
# Show full hashes on a sub-line (useful for copy-paste)
if sha1 or md5:
# Every hash the platform declares, whole: the crc32 is what
# System.dat and clrmamepro print, and pasting it found nothing
# for a pinned file the collection holds under other bytes.
crc32 = str(cfg_entry.get("crc32") or "")
if sha1 or md5 or crc32:
hash_parts = []
if sha1:
hash_parts.append(f"SHA1: `{sha1}`")
if md5:
hash_parts.append(f"MD5: `{md5}`")
if crc32:
hash_parts.append(f"CRC32: `{crc32}`")
lines.append(f"{pad} {' | '.join(hash_parts)}")
lines.append("")
+12
View File
@@ -242,5 +242,17 @@ class TheHomeTitleSaysWhatTheSiteIs(unittest.TestCase):
self.assertIn("BIOS", title)
class PlatformPagesPrintTheDeclaredCrc32(unittest.TestCase):
"""System.dat pins aes.zip by crc32 91e93107; the RetroArch page printed
only its sha1 and md5, so the crc a clrmamepro user pastes found nothing."""
def test_the_rendered_page(self):
page = ROOT / "docs" / "platforms" / "retroarch.md"
if not page.is_file():
self.skipTest("site not generated")
self.assertIn("CRC32: `91e93107`", page.read_text(encoding="utf-8"))
if __name__ == "__main__":
unittest.main()