Skip to content

Commit

Permalink
Update version number parsing to include esp-arduino-libs format
Browse files Browse the repository at this point in the history
  • Loading branch information
sgryphon committed Jan 14, 2024
1 parent b34d1f5 commit 4268187
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,15 @@ def _parse_version(original_version):
r"^gcc(?P<MAJOR>\d+)_(?P<MINOR>\d+)_(?P<PATCH>\d+)-esp-(?P<EXTRA>.+)$",
r"^esp-(?P<EXTRA>.+)-(?P<MAJOR>\d+)\.(?P<MINOR>\d+)\.?(?P<PATCH>\d+)$",
r"^esp-(?P<MAJOR>\d+)\.(?P<MINOR>\d+)\.(?P<PATCH>\d+)(_(?P<EXTRA>.+))?$",
r"^idf-release_v(?P<MAJOR>\d+)\.(?P<MINOR>\d+)(.(?P<PATCH>\d+))?(-(?P<EXTRA>.+))?$",
)
for pattern in version_patterns:
match = re.search(pattern, original_version)
if match:
result = "%s.%s.%s" % (
match.group("MAJOR"),
match.group("MINOR"),
match.group("PATCH"),
match.group("PATCH") if match.group("PATCH") is not None else "0",
)
if match.group("EXTRA"):
result = result + "+%s" % match.group("EXTRA")
Expand Down

0 comments on commit 4268187

Please sign in to comment.