From c39588807fda61ceda718b2b4c1af81c49cd2402 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 6 Oct 2026 12:26:47 +0200 Subject: [PATCH] fix: refuse --include-archived without --all --- scripts/generate_pack.py | 4 ++++ tests/test_e2e.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index 498dd3eb..f399a4fa 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -2480,6 +2480,10 @@ def _refuse_unapplied_flags(args, parser) -> None: about an artifact the caller did not name. Run before any quick-exit mode, since --verify-packs and --manifest-targets return early. """ + # Only --all chooses among registered platforms; every other mode names + # its own platform, emulator, system or hash. + if args.include_archived and not args.all: + parser.error("--include-archived requires --all") # Parsed before the quick-exit modes: --verify-packs returns early and # still needs the region priority list to narrow its expectation. args.regions = [] diff --git a/tests/test_e2e.py b/tests/test_e2e.py index 4193752a..b6167ee7 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -6011,6 +6011,13 @@ struct BurnDriver BurnDrvneogeo = { (["--system", "sony-playstation"], ["--refresh-data"], "refuse"), (["--from-md5", "d8f1"], ["--refresh-data"], "refuse"), (["--platform", "retroarch", "--offline"], ["--refresh-data"], "refuse"), + # Only --all chooses among platforms, as verify.py already says. + (["--platform", "retroarch"], ["--include-archived"], "refuse"), + (["--emulator", "handy"], ["--include-archived"], "refuse"), + (["--system", "atari-lynx"], ["--include-archived"], "refuse"), + (["--from-md5", "d8f1"], ["--include-archived"], "refuse"), + (["--platform", "retroarch", "--verify-packs"], ["--include-archived"], + "refuse"), ] for mode, flag, expected in matrix: with self.subTest(mode=mode, flag=flag):