From 2af2a1253cc557eb7a845132e65e68e14cfd2a4a Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 30 May 2015 17:59:50 +0200 Subject: Update findversion for change version.h format. version.h doesn't store the version number as string anymore. Update findversion to use the individual values instead. Change-Id: I6bf0fdd4420d41279b44cffd22b42febbfc778ce --- utils/common/deploy.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/common/deploy.py b/utils/common/deploy.py index 8f7fd72175..24163d2c98 100755 --- a/utils/common/deploy.py +++ b/utils/common/deploy.py @@ -127,13 +127,12 @@ def findversion(versionfile): h = open(versionfile, "r") c = h.read() h.close() - r = re.compile("#define +VERSION +\"(.[0-9\.a-z]+)\"") - m = re.search(r, c) - s = re.compile("\$Revision: +([0-9]+)") - n = re.search(s, c) - if n == None: - print "WARNING: Revision not found!" - return m.group(1) + version = dict() + for v in ['MAJOR', 'MINOR', 'MICRO']: + r = re.compile("#define +VERSION_" + v + " +([0-9a-z]+)") + m = re.search(r, c) + version[v] = m.group(1) + return "%s.%s.%s" % (version['MAJOR'], version['MINOR'], version['MICRO']) def findqt(cross=""): -- cgit v1.2.3