refactor: recipe modules read the repo root

This commit is contained in:
Abdessamad Derraz committed 2026-11-18 19:38:56 +01:00
1 parent 5f7cbdc582
commit 664776ae91
3 files changed
+7 -8

No files matched your search

+4 -3
View File
@@ -53,13 +53,14 @@ from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from core.cli import require_directory
from core.paths import REPO_ROOT
from model.database import load_database
from model.profiles import load_emulator_profiles
from model.platforms import load_platform_config
from model.registry import list_registered_platforms
from core.torrentzip import build_torrentzip, is_torrentzip
ARCHIVES_FILE = Path(__file__).resolve().parent.parent / "recipes" / "archives.json"
ARCHIVES_FILE = REPO_ROOT / "recipes" / "archives.json"
Recipe = list[tuple[str, str]]
@@ -228,11 +229,11 @@ class AtomPool:
return self._built[key]
DIGEST_CACHE = Path(__file__).resolve().parent.parent / ".cache" / "romset_digests.json"
DIGEST_CACHE = REPO_ROOT / ".cache" / "romset_digests.json"
# The writer's own source is part of every key: a change to how TorrentZip
# bytes are laid out invalidates every digest it produced.
_WRITER = hashlib.sha256(
(Path(__file__).resolve().parent / "core" / "torrentzip.py").read_bytes()
(REPO_ROOT / "scripts" / "core" / "torrentzip.py").read_bytes()
).hexdigest()[:16]