forked from len0rd/rockbox
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
This commit is contained in:
parent
47d053735b
commit
2af2a1253c
1 changed files with 6 additions and 7 deletions
|
@ -127,13 +127,12 @@ def findversion(versionfile):
|
||||||
h = open(versionfile, "r")
|
h = open(versionfile, "r")
|
||||||
c = h.read()
|
c = h.read()
|
||||||
h.close()
|
h.close()
|
||||||
r = re.compile("#define +VERSION +\"(.[0-9\.a-z]+)\"")
|
version = dict()
|
||||||
|
for v in ['MAJOR', 'MINOR', 'MICRO']:
|
||||||
|
r = re.compile("#define +VERSION_" + v + " +([0-9a-z]+)")
|
||||||
m = re.search(r, c)
|
m = re.search(r, c)
|
||||||
s = re.compile("\$Revision: +([0-9]+)")
|
version[v] = m.group(1)
|
||||||
n = re.search(s, c)
|
return "%s.%s.%s" % (version['MAJOR'], version['MINOR'], version['MICRO'])
|
||||||
if n == None:
|
|
||||||
print "WARNING: Revision not found!"
|
|
||||||
return m.group(1)
|
|
||||||
|
|
||||||
|
|
||||||
def findqt(cross=""):
|
def findqt(cross=""):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue