summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2019-06-15 07:17:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-15 11:06:38 +0100
commitb035b4dcee9122b5dd3799b48e4465e009bbed66 (patch)
tree6213bcb96fedfc26bd479f0c72097d0100ce670a /bitbake/lib/bb/utils.py
parenta358cc20104a554d1336fdb80bf39fe8603527ef (diff)
downloadpoky-b035b4dcee9122b5dd3799b48e4465e009bbed66.tar.gz
bitbake: bitbake: fix version comparison when one of the versions ends in .
Previously, this would happen: ====================================================================== ERROR: test_vercmpstring (bb.tests.utils.VerCmpString) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/alexander/development/poky/bitbake/lib/bb/tests/utils.py", line 45, in test_vercmpstring result = bb.utils.vercmp_string('1.', '1.1') File "/home/alexander/development/poky/bitbake/lib/bb/utils.py", line 143, in vercmp_string return vercmp(ta, tb) File "/home/alexander/development/poky/bitbake/lib/bb/utils.py", line 135, in vercmp r = vercmp_part(va, vb) File "/home/alexander/development/poky/bitbake/lib/bb/utils.py", line 124, in vercmp_part elif ca < cb: TypeError: '<' not supported between instances of 'NoneType' and 'int' ---------------------------------------------------------------------- (Bitbake rev: bd953d56d007a8bfa5ecb6e753da4abfb035f9f2) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 73b6cb423b..215c18cfa3 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -120,6 +120,10 @@ def vercmp_part(a, b):
120 return -1 120 return -1
121 elif oa > ob: 121 elif oa > ob:
122 return 1 122 return 1
123 elif ca is None:
124 return -1
125 elif cb is None:
126 return 1
123 elif ca < cb: 127 elif ca < cb:
124 return -1 128 return -1
125 elif ca > cb: 129 elif ca > cb: