mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 18:47:53 -06:00
fix: read targets and data from --platforms-dir
This commit is contained in:
1 parent
88e39b6380
commit
7203b5be84
4 files changed
+28
-17
No files matched your search
@@ -4,17 +4,18 @@ from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
import io
|
||||
from pathlib import Path
|
||||
|
||||
from core.paths import DATA_DIRS_FILE, REPO_ROOT
|
||||
from core.paths import DATA_DIRS_FILE
|
||||
from model.registry import load_data_dir_registry
|
||||
from packs import datadirs
|
||||
from freshness.findings import OK, SHOWN_NAMES, SKIPPED, STALE, UNKNOWN, Finding
|
||||
|
||||
|
||||
def check_data(offline: bool) -> list[Finding]:
|
||||
def check_data(platforms_dir: Path, offline: bool) -> list[Finding]:
|
||||
if offline:
|
||||
return [Finding("data", "_data_dirs.yml", SKIPPED, detail="offline")]
|
||||
registry = load_data_dir_registry(REPO_ROOT / "platforms", required=True)
|
||||
registry = load_data_dir_registry(platforms_dir, required=True)
|
||||
sink = io.StringIO()
|
||||
with contextlib.redirect_stdout(sink):
|
||||
results = datadirs.refresh_all(registry, dry_run=True)
|
||||
@@ -26,11 +27,11 @@ def check_data(offline: bool) -> list[Finding]:
|
||||
findings.append(Finding("data", key, STALE, detail="upstream changed, refresh_data_dirs.py fetches it"))
|
||||
else:
|
||||
findings.append(Finding("data", key, OK))
|
||||
findings.append(_check_buildbot_system())
|
||||
findings.append(_check_buildbot_system(platforms_dir))
|
||||
return findings
|
||||
|
||||
|
||||
def _check_buildbot_system() -> Finding:
|
||||
def _check_buildbot_system(platforms_dir: Path) -> Finding:
|
||||
"""The buildbot's system directory against what _data_dirs.yml tracks.
|
||||
|
||||
The registry entries are refreshed above. An asset published since, or
|
||||
@@ -39,9 +40,7 @@ def _check_buildbot_system() -> Finding:
|
||||
from scraper import buildbot_system
|
||||
|
||||
with contextlib.redirect_stdout(io.StringIO()):
|
||||
report = buildbot_system.check(
|
||||
str(REPO_ROOT / DATA_DIRS_FILE)
|
||||
)
|
||||
report = buildbot_system.check(str(platforms_dir / Path(DATA_DIRS_FILE).name))
|
||||
if report.get("error"):
|
||||
return Finding("data", "buildbot system", UNKNOWN, detail="index unreachable")
|
||||
todo = buildbot_system.pending(report)
|
||||
|
||||
Reference in new issue
Block a user