mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
makepanda: Make version parsing in CreatePandaVersionFiles more robust
This commit is contained in:
parent
27daecf030
commit
dcc96a60b1
@ -3038,11 +3038,18 @@ END
|
|||||||
#endif"""
|
#endif"""
|
||||||
|
|
||||||
def CreatePandaVersionFiles():
|
def CreatePandaVersionFiles():
|
||||||
version1=int(VERSION.split(".")[0])
|
parts = VERSION.split(".", 2)
|
||||||
version2=int(VERSION.split(".")[1])
|
version1 = int(parts[0])
|
||||||
version3=int(VERSION.split(".")[2])
|
version2 = int(parts[1])
|
||||||
nversion=version1*1000000+version2*1000+version3
|
version3 = 0
|
||||||
if (DISTRIBUTOR != "cmu"):
|
if len(parts) > 2:
|
||||||
|
for c in parts[2]:
|
||||||
|
if c.isdigit():
|
||||||
|
version3 = version3 * 10 + ord(c) - 48
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
nversion = version1 * 1000000 + version2 * 1000 + version3
|
||||||
|
if DISTRIBUTOR != "cmu":
|
||||||
# Subtract 1 if we are not an official version.
|
# Subtract 1 if we are not an official version.
|
||||||
nversion -= 1
|
nversion -= 1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user