mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 03:48: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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Scraper for Lakka per-device core availability.
|
||||
|
||||
Sources (libretro/Lakka-LibreELEC, at the latest Lakka release tag):
|
||||
Sources (libretro/Lakka-LibreELEC, at the release platforms/lakka.yml names):
|
||||
- packages/lakka/libretro_cores/package.mk -- LIBRETRO_CORES, then the
|
||||
EXCLUDE_LIBRETRO_CORES each PROJECT/DEVICE and OPENGLES_SUPPORT add
|
||||
- projects/<PROJECT>/options and projects/<PROJECT>/devices/<DEVICE>/options
|
||||
@@ -16,9 +16,8 @@ import re
|
||||
import sys
|
||||
from datetime import datetime, timezone
|
||||
|
||||
|
||||
from . import BaseTargetScraper, target_cli
|
||||
from ..base_scraper import fetch_github_latest_version, fetch_text, github_tree
|
||||
from ..base_scraper import fetch_text, github_tree
|
||||
|
||||
PLATFORM_NAME = "lakka"
|
||||
|
||||
@@ -220,7 +219,7 @@ class Scraper(BaseTargetScraper):
|
||||
return found
|
||||
|
||||
def fetch_targets(self) -> dict:
|
||||
self.tag = fetch_github_latest_version(REPO)
|
||||
self.tag = self.pinned_version(PLATFORM_NAME)
|
||||
cores_mk = self._raw(CORES_MK)
|
||||
targets: dict[str, dict] = {}
|
||||
for project, device in self._devices():
|
||||
|
||||
Reference in new issue
Block a user