From 666883ad53d9ae61d7456895a716a0711aec5305 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:41:02 +0100 Subject: [PATCH] fix: print missing core files under their count They came after the held-but-not-packed line and read as files installed with their emulator (finding 79). --- scripts/verify.py | 15 ++++++++------- tests/test_tool_messages.py | 12 ++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/scripts/verify.py b/scripts/verify.py index 3b1d73b6e..05bc92c99 100644 --- a/scripts/verify.py +++ b/scripts/verify.py @@ -1853,13 +1853,8 @@ def _print_undeclared_section(result: dict, verbose: bool) -> None: f" Core files: {core_in_pack} in pack, {core_missing_req} required missing, " f"{core_missing_opt} optional missing{listed}" ) - if bundled: - names = ", ".join(sorted({u["name"] for u in bundled})) - print(f" Bundled with their emulator, not collected: {names}") - if unplaced: - print(f" Core files held but not packed: {len(unplaced)} " - f"({_omission_reasons(unplaced)})") - + # The missing files follow the line that counts them: printed after the + # held-but-not-packed line, they read as files installed with their emulator. for u in req_not_in_repo: _print_undeclared_entry(u, "MISSING (required)", verbose) for u in req_hle_not_in_repo: @@ -1867,6 +1862,12 @@ def _print_undeclared_section(result: dict, verbose: bool) -> None: if verbose: for u in opt_not_in_repo: _print_undeclared_entry(u, "MISSING (optional)", verbose) + if bundled: + names = ", ".join(sorted({u["name"] for u in bundled})) + print(f" Bundled with their emulator, not collected: {names}") + if unplaced: + print(f" Core files held but not packed: {len(unplaced)} " + f"({_omission_reasons(unplaced)})") if game_data: gd_missing = [u for u in game_data if not u["in_repo"]] diff --git a/tests/test_tool_messages.py b/tests/test_tool_messages.py index a866120e2..76a069ad8 100644 --- a/tests/test_tool_messages.py +++ b/tests/test_tool_messages.py @@ -190,6 +190,18 @@ class HeldButNotPackedNamesEachReason(unittest.TestCase): "Game data held but not packed: 3 (2 installed with its emulator, " "1 no platform slug for its system)", text) + def test_a_missing_file_follows_the_line_that_counts_it(self): + """Indented under 'held but not packed: 102 (installed with its + emulator)', Batocera's one missing sfiii2a.zip read as one of them.""" + missing = {"name": "sfiii2a.zip", "emulator": "FinalBurn Neo", "required": True, + "in_repo": False, "category": "bios"} + lines = self._printed( + [missing, self._entry("a.rom", "installed with its emulator")] + ).splitlines() + self.assertTrue(lines[0].startswith(" Core files: "), lines) + self.assertIn("MISSING (required): FinalBurn Neo needs sfiii2a.zip", lines[1]) + self.assertTrue(lines[2].startswith(" Core files held but not packed: "), lines) + def test_a_single_reason_reads_as_before(self): text = self._printed([self._entry("a.rom", "installed with its emulator")] * 2) self.assertIn("Core files held but not packed: 2 (installed with its emulator)", text)