summaryrefslogtreecommitdiff
path: root/tools/utils.py
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-05-17 16:36:34 +0800
committerarmink <[email protected]>2019-05-17 17:07:14 +0800
commitbf4a51b599b56cddb93f7f2ad576f6f0d022a64e (patch)
treee9c54e3d37a1d3342d1bf19c44384b6c38703fac /tools/utils.py
parent94e3f77f25249b52c6f72921a2d2564f68bcd6ff (diff)
Update the kernel and components to master version.
Diffstat (limited to 'tools/utils.py')
-rw-r--r--tools/utils.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/utils.py b/tools/utils.py
index 6dc56322a5..9459396544 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -24,6 +24,7 @@
import sys
import os
+import re
def splitall(loc):
"""
@@ -245,10 +246,11 @@ def ProjectInfo(env):
return proj
def VersionCmp(ver1, ver2):
- la=[];
+ la=[]
if ver1:
- la = ver1.split('.')
- lb = ver2.split('.')
+ la = re.split("[. ]", ver1)
+ lb = re.split("[. ]", ver2)
+
f = 0
if len(la) > len(lb):
f = len(la)
@@ -262,7 +264,7 @@ def VersionCmp(ver1, ver2):
continue
else:
return -1
- except IndexError as e:
+ except (IndexError, ValueError) as e:
if len(la) > len(lb):
return 1
else:
@@ -274,7 +276,7 @@ def GCCC99Patch(cflags):
gcc_version = building.GetDepend('GCC_VERSION')
if gcc_version:
gcc_version = gcc_version.replace('"', '')
- if VersionCmp(gcc_version, "4.8.0"):
+ if VersionCmp(gcc_version, "4.8.0") == 1:
# remove -std=c99 after GCC 4.8.x
cflags = cflags.replace('-std=c99', '')