Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/unit_tests/common/test_ucsversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def test_version_parsing(self):
("4.2(0.175a)", {"major": "4", "minor": "2", "mr": "0", "patch": "a", "spin": None, "build": "175"}),
("4.2(1.2021052301)", {"major": "4", "minor": "2", "mr": "2", "patch": "a", "spin": None, "build": None}),
("4.2(1a.2021052301)", {"major": "4", "minor": "2", "mr": "1", "patch": "b", "spin": "2021052301", "build": None}),
("4.3(6.250037)", {"major": "4", "minor": "3", "mr": "6", "patch": "z", "spin": "250037", "build": None}),
]

for version_str, expected in test_cases:
Expand Down
12 changes: 12 additions & 0 deletions ucsmsdk/ucscoremeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ def __init__(self, version):
if self._set_versions(match_obj):
return

# handle spin builds "4.3(6.250037)" - short numeric spin build numbers (6-7 digits)
# e.g. 4.3(6.250037) is a spin build of 4.3(6x) branch, spin=250037
# (1-5 digit numbers are handled by the first pattern above as patch/interim builds,
# 8+ digit date-like numbers are handled by the special builds pattern below)
match_pattern = re.compile(r"^(?P<major>[1-9][0-9]{0,2})\."
r"(?P<minor>(([0-9])|([1-9][0-9]{0,1})))\("
r"(?P<mr>(([0-9])|([1-9][0-9]{0,2})))\."
r"(?P<spin>[1-9][0-9]{5,6})\)$")
match_obj = re.match(match_pattern, version)
if self._set_versions(match_obj):
return

# handle de special builds "66.77(67.1582251418)"
match_pattern = re.compile(r"^(?P<major>[1-9][0-9]{0,2})\."
r"(?P<minor>(([0-9])|([1-9][0-9]{0,2})))\("
Expand Down
Loading