From 5cc8612e3c2d839984d67ba5b7e02d1e1cc6995b Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Jun 2009 19:07:46 -0500 Subject: Improved regex and formatting in build_version.py. Handles empty test version strings better. --- linden/scripts/build_version.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'linden') diff --git a/linden/scripts/build_version.py b/linden/scripts/build_version.py index 3d66a65..908c57d 100755 --- a/linden/scripts/build_version.py +++ b/linden/scripts/build_version.py @@ -26,10 +26,16 @@ def get_version(filename): vals['minor'] = m.group(1) m = re.search('const S32 IMP_VERSION_PATCH = (\d+);', data) vals['patch'] = m.group(1) - m = re.search('const char \* const IMP_VERSION_TEST = "(.+)";', data) + m = re.search('const char \* const IMP_VERSION_TEST = "(.*)";', data) vals['test'] = m.group(1) - return "%(major)s.%(minor)s.%(patch)s-%(test)s" % vals + version = "%(major)s.%(minor)s.%(patch)s" % vals + + if len(vals['test']) > 0: + version += "-%(test)s" % vals + + return version + if __name__ == '__main__': import sys -- cgit v1.1