fix: lift unsourceable flags on collected paks

This commit is contained in:
Abdessamad Derraz committed 2026-10-15 23:38:16 +02:00
1 parent 2fb49d0658
commit 28857da8a6
3 files changed
+31 -3

No files matched your search

-2
View File
@@ -177,7 +177,6 @@ files:
required: false
source_ref: "SP/code/qcommon/files.c:181, 3858-3863, 3933-3946, 3969-3970"
note: "Single-player build: a pak0 under demomain/ with checksum 2985661941 stands in for main/pak0.pk3 with a warning, and the point-release check is skipped."
unsourceable: "demo data the collection does not hold yet; a same-named file of another game must not stand in"
- name: "pak0.pk3"
description: "Multiplayer demo"
@@ -187,4 +186,3 @@ files:
required: false
source_ref: "MP/code/qcommon/files.c:192, 3852-3857, 3927-3940, 3963-3964"
note: "Multiplayer build: a pak0 under demomain/ with checksum 2031778175 stands in for main/pak0.pk3 with a warning, and the point-release check is skipped."
unsourceable: "demo data the collection does not hold yet; a same-named file of another game must not stand in"
-1
View File
@@ -145,7 +145,6 @@ files:
required: false
source_ref: "code/qcommon/files.cpp:339 (fs_originalPaks_mainta[2])"
note: "Added by the 2.11 patch."
unsourceable: "patch data the collection does not hold yet; a same-named file of another game must not stand in"
- name: "pak4.pk3"
category: game_data
+31
View File
@@ -374,5 +374,36 @@ class BundledFilesComeFromTheirOwnTree(unittest.TestCase):
self.assertIn(f"/{owner}/", path or "")
class HeldFilesAreNotUnsourceable(unittest.TestCase):
"""`unsourceable:` says the collection cannot hold a file; once its bytes
sit at the path the entry names, the flag hides them.
The RTCW demo paks and the Spearhead 2.11 pak3 were collected the night
their entries were flagged "does not hold yet" and the flags stayed: they
reached two packs only through another game's same-named file, and left
them when that path closed.
"""
def test_no_flagged_entry_has_a_file_at_its_path(self):
db_path = REPO_ROOT / "database.json"
if not db_path.exists():
self.skipTest("database.json is not built")
by_suffix = load_database(str(db_path))["indexes"]["by_path_suffix"]
stale = []
for name, profile in load_emulator_profiles(str(REPO_ROOT / "emulators")).items():
for entry in profile.get("files", []):
if not entry.get("unsourceable"):
continue
for key in ("path", "standalone_path"):
dest = entry.get(key)
if not isinstance(dest, str) or "/" not in dest:
continue
if dest.endswith("/"):
dest += entry.get("name", "")
if dest in by_suffix:
stale.append((name, dest))
self.assertEqual(stale, [])
if __name__ == "__main__":
unittest.main()