File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,22 @@ jobs:
9191 if version_str == 'N/A':
9292 return version_str
9393
94- # Simply reverse the order of version components
94+ # Version format should be FAMILY.MAJOR.MINOR.PATCH
95+ # If the version appears reversed (PATCH.MINOR.MAJOR.FAMILY), fix it
9596 parts = version_str.split('.')
9697 if len(parts) >= 4:
97- # Reverse the parts
98- parts = parts[::-1]
99- return '.'.join(parts)
98+ # Check if this looks like a reversed version (patch.min.maj.fam -> fam.maj.min.patch)
99+ # If the first part is larger than the last part, it's likely reversed
100+ try:
101+ first_part = int(parts[0])
102+ last_part = int(parts[-1])
103+ if first_part > last_part:
104+ # Reverse the parts to get FAMILY.MAJOR.MINOR.PATCH
105+ parts = parts[::-1]
106+ return '.'.join(parts)
107+ except ValueError:
108+ # If we can't parse as integers, return as is
109+ pass
100110
101111 return version_str
102112
You can’t perform that action at this time.
0 commit comments