Below is a stand-alone python script with the code from SConscript that generates version information for version.cpp.in:
#!/usr/bin/python import re import sys VER = sys.argv[1] version_parts = [ x for x in re.match(r'^(\d+)\.(\d+)\.(\d+)-?((?:(rc)(\d+))?.*)?', VER).groups() ] version_extra = version_parts[3] if version_parts[3] else "" if version_parts[4] == 'rc': version_parts[3] = int(version_parts[5]) + -50 elif version_parts[3]: version_parts[3] = -100 else: version_parts[3] = 0 version_array = [ int(x) for x in version_parts[:4]] print version_array
It produces the following output:
$ ./ver.py 3.3.1 [3, 3, 1, 0] $ ./ver.py 3.3.1-1-abcd [3, 3, 1, -100]
This indicates that 3.3.1 is newer than the first commit after 3.3.1, which is wrong.
- related to
-
SERVER-17329 Improve management of server version in build system
- Closed