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

versionArray not computed correctly from git-describe

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.0-rc3
    • Component/s: Build
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Build B (10/30/15), Build C (11/20/15)

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: