mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-01 13:58:55 -06:00
fix: one system name rule for install and remove
The removal resolved --system against the list's ids alone, so a platform name or a site title that installed the files was refused as an unknown system. Both paths now call resolve_systems.
This commit is contained in:
1 parent
475dfe0e0a
commit
80f42f0573
7 files changed
+50
-23
No files matched your search
+11
-6
@@ -10713,6 +10713,15 @@ def resolve_choices(
|
||||
return chosen
|
||||
|
||||
|
||||
def resolve_systems(values: list[str], manifest: dict | None, files: list[dict],
|
||||
omitted: list[dict]) -> list[str]:
|
||||
"""The systems --system names, for an install and a removal alike: the
|
||||
list's ids, the platform's own names and the site's titles. --remove
|
||||
took the ids alone, and refused the psx that installed the files."""
|
||||
return resolve_choices(values, available_choices(files, omitted)["systems"], "system",
|
||||
system_aliases(manifest), key_file_holders(files, omitted))
|
||||
|
||||
|
||||
def parse_selection(text: str, count: int, ordered: bool = False) -> list[int]:
|
||||
"""Numbers typed at a prompt: `3`, `1,4`, `2-5`, or `all`, 1-based.
|
||||
|
||||
@@ -11010,10 +11019,7 @@ def _requested_narrowing(
|
||||
sys.exit(1)
|
||||
choices = available_choices(files, omitted)
|
||||
try:
|
||||
systems = resolve_choices(
|
||||
args.system or [], choices["systems"], "system", system_aliases(manifest),
|
||||
key_file_holders(files, omitted),
|
||||
)
|
||||
systems = resolve_systems(args.system or [], manifest, files, omitted)
|
||||
cores = resolve_choices(args.core or [], choices["cores"], "core")
|
||||
regions = resolve_regions(args.region or [])
|
||||
except ValueError as exc:
|
||||
@@ -20382,8 +20388,7 @@ def run_removal(args: argparse.Namespace) -> int:
|
||||
omitted = list(manifest.get("omitted_files") or [])
|
||||
known = available_choices(every, omitted)
|
||||
try:
|
||||
systems = resolve_choices(args.system, known["systems"], "system") \
|
||||
if args.system else []
|
||||
systems = resolve_systems(args.system or [], manifest, every, omitted)
|
||||
cores = resolve_choices(args.core, known["cores"], "core") if args.core else []
|
||||
emulators = resolve_choices(args.emulator, sorted(emulator_names(
|
||||
manifest, every, omitted)), "emulator") if args.emulator else []
|
||||
|
||||
Reference in new issue
Block a user