Commit a7ab7eca authored by Hubert Degaudenzi's avatar Hubert Degaudenzi
Browse files

Modified createProjVersHeader.py to understand only the LHCb, ATLAS and plain version styles.

- LHCb: vXrY[pZ]
- ATLAS: bla-X-Y[-Z]
- plain:X.Y[.Z]
parent e2b65d62
package GaudiPolicy
package manager: Marco Clemencic
! 2013-03-27 - Hubert Degaudenzi
- Modified createProjVersHeader.py to understand only the LHCb version
style(vXrY[pZ]) , the ATLAS version style (bla-X-Y[-Z]) and the plain
version style (X.Y[.Z])
! 2013-03-22 - Marco Clemencic
- Enable C++11 by default when using gcc 4.7
......
......@@ -4,6 +4,12 @@ import os
import sys
import re
from optparse import OptionParser
lhcb_ver_style = "v(?P<maj_ver>[0-9]+)r(?P<min_ver>[0-9]+)(?:p(?P<pat_ver>[0-9]+))?"
atlas_ver_style = "[A-Za-z]+\-(?P<maj_ver>[0-9]+)\-(?P<min_ver>[0-9]+)(?:\-(?P<pat_ver>[0-9]+))?"
plain_ver_style = "(?P<maj_ver>[0-9]+)\.(?P<min_ver>[0-9]+)(?:\.(?P<pat_ver>[0-9]+))?"
def main():
parser = OptionParser(usage="ERROR: Usage %prog <project> <version> <outputfile>")
parser.add_option("-q", "--quiet", action="store_true",
......@@ -19,7 +25,10 @@ def main():
if version.startswith('HEAD'):
majver, minver, patver = 999, 999, 0 # special handling
else:
m = re.match("(v|([A-Za-z]+\-))(?P<maj_ver>[0-9]+)(r|\-)(?P<min_ver>[0-9]+)(?:(p|\-)(?P<pat_ver>[0-9]+))?", version)
for style in [lhcb_ver_style, atlas_ver_style, plain_ver_style ] :
m = re.match(style, version)
if m :
break
majver = int(m.groupdict()['maj_ver'])
minver = int(m.groupdict()['min_ver'])
patver = int(m.groupdict()['pat_ver'] or 0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment