mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-18 01:13:30 -05:00
fix: name the platform a typo was meant to be
This commit is contained in:
1 parent
2645626684
commit
b6331a765a
5 files changed
+49
No files matched your search
@@ -350,6 +350,24 @@ def list_registered_platforms(
|
||||
return platforms
|
||||
|
||||
|
||||
def require_platform(name: str, platforms_dir: str = "platforms") -> None:
|
||||
"""Exit with a usable message when no platform answers to a name.
|
||||
|
||||
A typo used to end in a traceback (verify, cross_reference) or in "no
|
||||
pack for batocra" after the whole build ran (generate_pack).
|
||||
"""
|
||||
if os.path.exists(os.path.join(platforms_dir, f"{name}.yml")):
|
||||
return
|
||||
import difflib # noqa: PLC0415
|
||||
|
||||
known = list_registered_platforms(platforms_dir, include_archived=True)
|
||||
close = difflib.get_close_matches(name, known, n=1)
|
||||
hint = f" Did you mean '{close[0]}'?" if close else ""
|
||||
raise SystemExit(
|
||||
f"ERROR: unknown platform '{name}'.{hint}\nKnown platforms: {', '.join(known)}"
|
||||
)
|
||||
|
||||
|
||||
def _target_overrides(platform_name: str, targets_dir: str) -> dict:
|
||||
overrides_file = os.path.join(targets_dir, "_overrides.yml")
|
||||
if not os.path.exists(overrides_file):
|
||||
|
||||
@@ -20,6 +20,7 @@ from pathlib import Path
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
from common import (
|
||||
require_platform,
|
||||
_norm_system_id,
|
||||
directory_members,
|
||||
get_mame_clone_map,
|
||||
@@ -642,6 +643,8 @@ def main():
|
||||
parser.add_argument("--target", "-t", help="Hardware target (e.g., switch, rpi4)")
|
||||
parser.add_argument("--json", action="store_true", help="JSON output")
|
||||
args = parser.parse_args()
|
||||
if args.platform:
|
||||
require_platform(args.platform, args.platforms_dir)
|
||||
|
||||
profiles = load_emulator_profiles(args.emulators_dir)
|
||||
if args.emulator:
|
||||
|
||||
@@ -30,6 +30,7 @@ from pathlib import Path
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
from common import resolve_platform_cores as _platform_cores
|
||||
from common import (
|
||||
require_platform,
|
||||
apply_target_overrides,
|
||||
archive_entry,
|
||||
profiles_for_systems,
|
||||
@@ -2846,6 +2847,9 @@ def main():
|
||||
)
|
||||
args = parser.parse_args()
|
||||
packresolve.set_offline(bool(args.offline))
|
||||
if args.platform:
|
||||
for name in args.platform.split(","):
|
||||
require_platform(name.strip(), args.platforms_dir)
|
||||
|
||||
_refuse_unapplied_flags(args, parser)
|
||||
if args.target:
|
||||
|
||||
@@ -34,6 +34,7 @@ import slots
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
from common import (
|
||||
require_platform,
|
||||
archive_entry,
|
||||
archive_members,
|
||||
profiles_for_systems,
|
||||
@@ -2064,6 +2065,8 @@ def main():
|
||||
)
|
||||
parser.add_argument("--json", action="store_true", help="JSON output")
|
||||
args = parser.parse_args()
|
||||
if args.platform:
|
||||
require_platform(args.platform, args.platforms_dir)
|
||||
|
||||
requested_regions: list[str] = []
|
||||
if getattr(args, "region", None):
|
||||
|
||||
Reference in new issue
Block a user