Convert string to int to fix the following error:

>>> "5.10" >= "5.5"
False

Signed-off-by: Yongxin Liu <[email protected]>
---
 recipes-extended/qat/qat17_4.7.0-00006.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/recipes-extended/qat/qat17_4.7.0-00006.bb 
b/recipes-extended/qat/qat17_4.7.0-00006.bb
index 047c184..b6143ae 100644
--- a/recipes-extended/qat/qat17_4.7.0-00006.bb
+++ b/recipes-extended/qat/qat17_4.7.0-00006.bb
@@ -30,9 +30,12 @@ SRC_URI = 
"https://01.org/sites/default/files/downloads/qat1.7.l.4.7.0-00006.tar
 do_fetch[depends] += "virtual/kernel:do_shared_workdir"
 
 do_patch_append () {
-    if d.getVar("KERNEL_VERSION") >= "5.5%":
+    kernel_version = int(d.getVar("KERNEL_VERSION").split(".")[0])
+    kernel_patchlevel = int(d.getVar("KERNEL_VERSION").split(".")[1])
+
+    if kernel_version >= 5 and kernel_patchlevel >= 5:
         bb.build.exec_func('do_switch_to_skcipher_api', d)
-    if d.getVar("KERNEL_VERSION") >= "5.6%":
+    if kernel_version >= 5 and kernel_patchlevel >= 6:
         bb.build.exec_func('do_patch_for_kernel_5_6', d)
 }
 
-- 
2.14.4

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#6828): 
https://lists.yoctoproject.org/g/meta-intel/message/6828
Mute This Topic: https://lists.yoctoproject.org/mt/78495136/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to