diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-14 17:36:31 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-01-14 23:29:31 +0000 |
commit | f00e5cf964d0ea48d517f0b8f9ca2aba646ea807 (patch) | |
tree | c2bc884ee3192895549745326c2752fe7200a206 /bitbake-dev/lib/bb/utils.py | |
parent | a7740492afa04d9a1bdcb907df91900d251fa29f (diff) | |
download | openembedded-core-f00e5cf964d0ea48d517f0b8f9ca2aba646ea807.tar.gz openembedded-core-f00e5cf964d0ea48d517f0b8f9ca2aba646ea807.tar.bz2 openembedded-core-f00e5cf964d0ea48d517f0b8f9ca2aba646ea807.zip |
bitbake-dev: Sync with upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake-dev/lib/bb/utils.py')
-rw-r--r-- | bitbake-dev/lib/bb/utils.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py index 603c926422..5b0aaba4a7 100644 --- a/bitbake-dev/lib/bb/utils.py +++ b/bitbake-dev/lib/bb/utils.py @@ -21,8 +21,9 @@ BitBake Utility Functions digits = "0123456789" ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +separators = ".-" -import re, fcntl, os +import re, fcntl, os, types def explode_version(s): r = [] @@ -39,12 +40,15 @@ def explode_version(s): r.append(m.group(1)) s = m.group(2) continue + r.append(s[0]) s = s[1:] return r def vercmp_part(a, b): va = explode_version(a) vb = explode_version(b) + sa = False + sb = False while True: if va == []: ca = None @@ -56,6 +60,16 @@ def vercmp_part(a, b): cb = vb.pop(0) if ca == None and cb == None: return 0 + + if type(ca) is types.StringType: + sa = ca in separators + if type(cb) is types.StringType: + sb = cb in separators + if sa and not sb: + return -1 + if not sa and sb: + return 1 + if ca > cb: return 1 if ca < cb: |