Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-21286

versionArray not computed correctly from git-describe

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc3
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Fully Compatible
    • ALL
    • Build B (10/30/15), Build C (11/20/15)

      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.

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: