fix: strip only a hash suffix off variant names

slots dropped the last extension of any .variants/ name, so a
variant stored under its plain name (63 of them, aes.zip among
them) was not the family of its primary and a platform declaring
both at one path would read as a collision. The database already
stripped an eight-hex suffix only; both now read one function.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 02:33:10 +02:00
1 parent 6448a1ab3d
commit fd6ae1f5c9
4 files changed
+44 -12

No files matched your search

+4 -11
View File
@@ -28,6 +28,7 @@ from common import (
load_provenance_snapshots,
require_yaml,
source_yaml_paths,
variant_base_name,
write_if_changed,
write_text_atomic,
yaml_load,
@@ -65,17 +66,9 @@ def should_skip(path: Path) -> bool:
def _canonical_name(filepath: Path) -> str:
"""Get canonical filename, stripping .variants/ hash suffix."""
name = filepath.name
if "/.variants/" in str(filepath) or "\\.variants\\" in str(filepath):
# naomi2.zip.da79eca4 -> naomi2.zip
parts = name.rsplit(".", 1)
if (
len(parts) == 2
and len(parts[1]) == 8
and all(c in "0123456789abcdef" for c in parts[1])
):
return parts[0]
return name
if ".variants" in filepath.parts:
return variant_base_name(filepath.name)
return filepath.name
def scan_bios_dir(bios_dir: Path, cache: dict, force: bool) -> tuple[dict, dict, dict]: