Skip to content

Commit 4268187

Browse files
committed
Update version number parsing to include esp-arduino-libs format
1 parent b34d1f5 commit 4268187

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,15 @@ def _parse_version(original_version):
321321
r"^gcc(?P<MAJOR>\d+)_(?P<MINOR>\d+)_(?P<PATCH>\d+)-esp-(?P<EXTRA>.+)$",
322322
r"^esp-(?P<EXTRA>.+)-(?P<MAJOR>\d+)\.(?P<MINOR>\d+)\.?(?P<PATCH>\d+)$",
323323
r"^esp-(?P<MAJOR>\d+)\.(?P<MINOR>\d+)\.(?P<PATCH>\d+)(_(?P<EXTRA>.+))?$",
324+
r"^idf-release_v(?P<MAJOR>\d+)\.(?P<MINOR>\d+)(.(?P<PATCH>\d+))?(-(?P<EXTRA>.+))?$",
324325
)
325326
for pattern in version_patterns:
326327
match = re.search(pattern, original_version)
327328
if match:
328329
result = "%s.%s.%s" % (
329330
match.group("MAJOR"),
330331
match.group("MINOR"),
331-
match.group("PATCH"),
332+
match.group("PATCH") if match.group("PATCH") is not None else "0",
332333
)
333334
if match.group("EXTRA"):
334335
result = result + "+%s" % match.group("EXTRA")

0 commit comments

Comments
 (0)