fix: refuse a platform list where one is taken

generate_pack split --platform on commas to validate it, then used
the whole string as one platform and crashed. Every script takes a
single platform; a list is refused with a message pointing at --all.
This commit is contained in:
Abdessamad Derraz committed 2026-10-18 02:50:58 +02:00
1 parent 1bdfb8d75e
commit 9ba63e6a54
3 files changed
+40 -2

No files matched your search

+7
View File
@@ -424,6 +424,13 @@ def require_platform(name: str, platforms_dir: str = "platforms") -> None:
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 "," in name:
# generate_pack split the list to validate it, then used the whole
# string as one name and ended in a traceback.
raise SystemExit(
f"ERROR: --platform takes one platform, not '{name}'. "
"Run once per platform, or use --all."
)
if os.path.exists(os.path.join(platforms_dir, f"{name}.yml")):
return
import difflib # noqa: PLC0415