fix: keep the digest cache beside the scanned tree

The cache path and .gitignore were read from the working directory: a
scan of a copy replaced the repository's cache with the copy's entries,
keyed bios/... like the real ones, and the next run rehashed everything.
Both now come from the tree holding bios/, and kept release assets are
restored under it.
This commit is contained in:
Abdessamad Derraz committed 2026-11-22 00:58:05 +01:00
1 parent 936e9ceed9
commit 940893d7d4
6 files changed
+70 -24

No files matched your search

+10 -2
View File
@@ -4,11 +4,19 @@ from __future__ import annotations
import json
import os
from pathlib import Path
from core.artifacts import write_text_atomic
CACHE_DIR = ".cache"
CACHE_FILE = os.path.join(CACHE_DIR, "db_cache.json")
def cache_path(bios_dir: Path) -> str:
"""The cache of the tree holding bios_dir, beside it as its keys are relative to it.
A path fixed on the working directory let a scan of a copy (tmp/wt/bios)
replace the repository's cache with the copy's entries, keyed bios/...
like the real ones, and the next real run rehashed every file.
"""
return str(bios_dir.parent / ".cache" / "db_cache.json")
def load_cache(cache_path: str) -> dict: