chore: merge resolver and export fixes

This commit is contained in:
Abdessamad Derraz committed 2026-11-06 05:54:29 +01:00
commit df801fd311
69 files changed
+2421 -6963

No files matched your search

+16 -3
View File
@@ -56,6 +56,18 @@ _VERSION = re.compile(r'^__version="([^"]+)"', re.MULTILINE)
_PACKAGE_DIRS = _SCRIPT_SECTIONS
def core_name(module_id: str) -> str:
"""The core a RetroPie package installs, as the buildbot names it.
A libretro package is lr-<core> with the name hyphenated (lr-beetle-psx
builds beetle_psx). A standalone package keeps its id (dosbox-staging).
The platform and target scrapers both read it here.
"""
if module_id.startswith("lr-"):
return module_id[3:].replace("-", "_")
return module_id
class Scraper(BaseScraper):
"""Scraper for the RetroPie package list."""
@@ -148,10 +160,11 @@ class Scraper(BaseScraper):
libretro cores and reads the same files, at BIOS/ instead of
system/. Only the core list is its own.
"""
# A libretro package is lr-<core>; a standalone package is named
# after the emulator itself.
# Named by core_name(), as the target scraper names them. Kept
# hyphenated, lr-dosbox-pure named dosbox-pure, the standalone
# DOSBox Pure Unleashed build RetroPie does not ship.
modules = self.module_ids()
cores = sorted({module.removeprefix("lr-") for module in modules})
cores = sorted({core_name(m) for m in modules})
libretro = {m.removeprefix("lr-") for m in modules if m.startswith("lr-")}
# The retroarch package is the frontend that runs the lr- cores.
standalone = sorted(
@@ -19,6 +19,7 @@ from datetime import datetime, timezone
import yaml
from ..retropie_scraper import core_name
from . import BaseTargetScraper
PLATFORM_NAME = "retropie"
@@ -158,15 +159,10 @@ class Scraper(BaseTargetScraper):
if not module_id:
print(f" warning: no rp_module_id in {filename}", file=sys.stderr)
continue
# A libretro package is lr-<core> with the buildbot name hyphenated
# (lr-beetle-psx -> beetle_psx), and a standalone package keeps the id
# the platform list carries (dosbox-staging).
core_name = module_id
if core_name.startswith("lr-"):
core_name = core_name[3:].replace("-", "_")
# The platform scraper names the package the same way.
for platform in PLATFORM_FLAGS:
if _is_available(flags, platform):
platform_cores[platform].add(core_name)
platform_cores[platform].add(core_name(module_id))
print(f" parsed {len(filenames)} scriptmodules", file=sys.stderr)
@@ -30,8 +30,10 @@ DEVICES_DIR = "projects/ROCKNIX/devices"
try:
from ..base_scraper import fetch_bytes, github_headers
from ..rocknix_scraper import standalone_emulators
except ImportError:
from scraper.base_scraper import fetch_bytes, github_headers
from scraper.rocknix_scraper import standalone_emulators
# `NAME="a b \
# c"` or `NAME+=" a b"`, continuation lines joined first.
@@ -91,11 +93,13 @@ def core_names(libretro: list[str], standalone: list[str]) -> list[str]:
"""Package names as the profiles' cores: lists spell them.
A libretro package is the core's name with `-lr` (`beetle-psx-lr`,
`neocd_lr`), spelled with underscores as the buildbot names it, and a
standalone package drops its `-sa` (`duckstation-sa`, `hatarisa`).
`neocd_lr`), spelled with underscores as the buildbot names it. A
standalone package is kept under both spellings, as the platform
scraper keeps it: `vice-sa` is the only name vice-standalone answers
to, `vice` that of the libretro profile.
"""
names = {re.sub(r"[-_]lr$", "", package).replace("-", "_") for package in libretro}
names.update(re.sub(r"-?sa$", "", package) for package in standalone)
names.update(standalone_emulators(standalone))
return sorted(names)