summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index d7cefb245f..21d3a812d3 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -60,6 +60,20 @@ def explode_version(s):
60 s = s[1:] 60 s = s[1:]
61 return r 61 return r
62 62
63def split_version(s):
64 """Split a version string into its constituent parts (PE, PV, PR)"""
65 s = s.strip(" <>=")
66 e = 0
67 if s.count(':'):
68 e = int(s.split(":")[0])
69 s = s.split(":")[1]
70 r = ""
71 if s.count('-'):
72 r = s.rsplit("-", 1)[1]
73 s = s.rsplit("-", 1)[0]
74 v = s
75 return (e, v, r)
76
63def vercmp_part(a, b): 77def vercmp_part(a, b):
64 va = explode_version(a) 78 va = explode_version(a)
65 vb = explode_version(b) 79 vb = explode_version(b)