Fix tree rendering and authored collision, add FPS display and packaging safeguards

This commit is contained in:
shen
2026-10-14 19:16:39 -07:00
parent b3808d8d0c
commit 3166b61321
35 changed files with 31336 additions and 49 deletions
+14 -3
View File
@@ -78,6 +78,9 @@ class Stage:
def add(self, rel, source):
key = str(rel).lower()
# Saved accounts are user data, never part of a development asset install.
if key == "lib/wa_ac.py":
return
old = self.files.pop(key, None)
if old is not None:
old.unlink()
@@ -91,13 +94,21 @@ class Stage:
def walk(top, pack_maker, missing):
"""Yields (relative path, real file) under top, following and remapping symlinks."""
stack = [(Path(top), Path())]
stack = [(Path(top), Path(), frozenset())]
while stack:
directory, rel = stack.pop()
directory, rel, ancestors = stack.pop()
identity = directory.resolve()
if identity in ancestors:
continue
ancestors = ancestors | {identity}
for entry in sorted(os.scandir(directory), key=lambda e: e.name):
path, child = Path(entry.path), rel / entry.name
if entry.name == ".DS_Store":
continue
# This local convenience link points to the entire decoded pack tree;
# its runtime files are already supplied by the flattened rundir.
if Path(top) == ROOT / "upstream/python-root" and child == Path("pack_maker"):
continue
if entry.is_symlink() and not path.exists():
link = os.readlink(path)
mark = link.find(PACK_MAKER_MARK)
@@ -108,7 +119,7 @@ def walk(top, pack_maker, missing):
continue
path = remapped
if path.is_dir():
stack.append((path, child))
stack.append((path, child, ancestors))
elif path.is_file():
yield child, path