mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-23 19:32:13 +03:00
The initial migration to a Bazel based build. All attempts have been made to maintain configuration parity with the upstream build.
27 lines
726 B
Python
27 lines
726 B
Python
"Version string utilities."
|
|
|
|
def parse_version(version):
|
|
"""Parses raw version string into a structured version object.
|
|
|
|
Returns:
|
|
struct: Contains version components:
|
|
- full: Full version
|
|
- gid: Version git id
|
|
- major: Major version number
|
|
- minor: Minor version number
|
|
- patch: Patch version number
|
|
- bugfix: Bugfix version
|
|
- nrev: Revision number
|
|
"""
|
|
prefix, gid = version.split("-bcr", 2)
|
|
major, minor, patch = prefix.split(".", 3)
|
|
|
|
return struct(
|
|
full = prefix,
|
|
gid = "0",
|
|
major = major,
|
|
minor = minor,
|
|
patch = patch,
|
|
bugfix = "0",
|
|
nrev = "0",
|
|
)
|