diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index 66b507e1d..bfa698e85 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -4515,11 +4515,7 @@ def _manifest_core_entries( ): systems = _extra_system_ids(fe) record_omission( - full_dest, - fe, - systems[0] if systems else "", - status, - [source_emu] if source_emu else [], + full_dest, fe, systems[0] if systems else "", status, _claim_cores(fe), ) continue @@ -4554,7 +4550,7 @@ def _manifest_core_entries( systems = _extra_system_ids(fe) record_omission( full_dest, fe, systems[0] if systems else "", "not_found", - [source_emu] if source_emu else [], + _claim_cores(fe), ) if file_size: pack_only_sizes.append(file_size) @@ -4668,6 +4664,17 @@ def _manifest_selection( ), held +def _claim_cores(fe: dict) -> list[str]: + """The cores an extra and the claims folded onto it name: an omission + names every core reading the file, as a list built for one of them + would.""" + names = { + claim.get("source_profile") or claim.get("source_emulator", "") + for claim in (fe, *fe.get("other_claims", [])) + } + return sorted(name for name in names if name) + + def _record_absent( absent: list[dict], config: dict, diff --git a/tests/test_audit_regressions.py b/tests/test_audit_regressions.py index aa6cbf37a..a6b0a7aab 100644 --- a/tests/test_audit_regressions.py +++ b/tests/test_audit_regressions.py @@ -7824,6 +7824,15 @@ class EveryReaderOfACoreFileIsNamed(unittest.TestCase): {"profile": "drastic-legacy", "bundled": True}]} self.assertEqual(_split_bundled_claims([alone]), [alone]) + def test_a_held_file_out_of_reach_names_every_core_reading_it(self): + """harm1.wad is a release asset: a checkout without it omits the file, + and the omission named gzdoom alone where lzdoom reads it too.""" + from generate_pack import _claim_cores + + extra = {"source_profile": "gzdoom", "other_claims": [ + {"source_profile": "uzdoom"}, {"source_profile": "lzdoom"}]} + self.assertEqual(_claim_cores(extra), ["gzdoom", "lzdoom", "uzdoom"]) + def test_a_missing_file_names_every_core_reading_it(self): from generate_pack import _record_absent