mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Handle legacy "system": "all" for package manifest
This commit is contained in:
@ -79,7 +79,7 @@ class PkgRepoMixin(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_system_compatible(valid_systems):
|
def is_system_compatible(valid_systems):
|
||||||
if valid_systems in (None, "all", "*"):
|
if not valid_systems or "*" in valid_systems:
|
||||||
return True
|
return True
|
||||||
if not isinstance(valid_systems, list):
|
if not isinstance(valid_systems, list):
|
||||||
valid_systems = list([valid_systems])
|
valid_systems = list([valid_systems])
|
||||||
|
@ -537,7 +537,7 @@ class PackageJsonManifestParser(BaseManifestParser):
|
|||||||
def _parse_system(data):
|
def _parse_system(data):
|
||||||
if "system" not in data:
|
if "system" not in data:
|
||||||
return data
|
return data
|
||||||
if data["system"] in ("*", ["*"]):
|
if data["system"] in ("*", ["*"], "all"):
|
||||||
del data["system"]
|
del data["system"]
|
||||||
return data
|
return data
|
||||||
if not isinstance(data["system"], list):
|
if not isinstance(data["system"], list):
|
||||||
|
@ -479,6 +479,11 @@ def test_package_json_schema():
|
|||||||
)
|
)
|
||||||
assert "system" not in mp.as_dict()
|
assert "system" not in mp.as_dict()
|
||||||
|
|
||||||
|
mp = parser.ManifestParserFactory.new(
|
||||||
|
'{"system": "all"}', parser.ManifestFileType.PACKAGE_JSON
|
||||||
|
)
|
||||||
|
assert "system" not in mp.as_dict()
|
||||||
|
|
||||||
mp = parser.ManifestParserFactory.new(
|
mp = parser.ManifestParserFactory.new(
|
||||||
'{"system": "darwin_x86_64"}', parser.ManifestFileType.PACKAGE_JSON
|
'{"system": "darwin_x86_64"}', parser.ManifestFileType.PACKAGE_JSON
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user