mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-28 20:38:52 -06:00
fix: read the lakka release from lakka.yml
The target scraper asked for the latest Lakka release while lakka.yml named its version by hand, kept in step by a test alone. The scraper now reads that field, and check_freshness reports a newer Lakka release.
This commit is contained in:
1 parent
852415a0e4
commit
35b5458a2d
9 files changed
+113
-7
No files matched your search
@@ -12,6 +12,7 @@ from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
|
||||
from model.safeparse import require_yaml
|
||||
from model.sources import source_yaml_file
|
||||
from model.sourcerevision import platform_revision
|
||||
|
||||
# Every target scraper reads the network through the platform scrapers'
|
||||
@@ -47,6 +48,22 @@ class BaseTargetScraper(ABC):
|
||||
)
|
||||
return platform_revision(directory / f"{platform}.yml")
|
||||
|
||||
@staticmethod
|
||||
def pinned_version(platform: str, platforms_dir: str | None = None) -> str:
|
||||
"""The release tag platforms/<platform>.yml names in its own `version:`.
|
||||
|
||||
A platform that inherits its BIOS list (Lakka) has no source of its
|
||||
own to pin: its file names the release by hand, and moving to a new
|
||||
release is an edit of that field.
|
||||
"""
|
||||
directory = Path(platforms_dir) if platforms_dir else (
|
||||
Path(__file__).resolve().parents[3] / "platforms"
|
||||
)
|
||||
version = str((source_yaml_file(directory / f"{platform}.yml") or {}).get("version") or "")
|
||||
if not version:
|
||||
raise RuntimeError(f"platforms/{platform}.yml names no version")
|
||||
return version
|
||||
|
||||
def write_output(self, data: dict, output_path: str) -> None:
|
||||
"""Write target data to YAML file."""
|
||||
from core.artifacts import write_text_atomic
|
||||
|
||||
Reference in new issue
Block a user