commit: 1646e870d312060d7920869eec8416a8753724b6 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Thu Aug 26 09:20:04 2021 +0000 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> CommitDate: Fri Aug 27 17:21:35 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1646e870
kernel-2.eclass: Replace bit-shift arithmetic by ver_test There are kernel versions like 4.9.280, therefore shifting version components by 8 bits in kernel_is() may fail. Reviewed-by: Alice Ferrazzi <alicef <AT> gentoo.org> Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> eclass/kernel-2.eclass | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 58e0bae94ee..1913942a679 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -561,7 +561,7 @@ kernel_is() { unset v n # Now we can continue - local operator test value + local operator case ${1#-} in lt) operator="-lt"; shift;; @@ -573,9 +573,10 @@ kernel_is() { esac [[ $# -gt 3 ]] && die "Error in kernel-2_kernel_is(): too many parameters" - : $(( test = (KV_MAJOR << 16) + (KV_MINOR << 8) + KV_PATCH )) - : $(( value = (${1:-${KV_MAJOR}} << 16) + (${2:-${KV_MINOR}} << 8) + ${3:-${KV_PATCH}} )) - [ ${test} ${operator} ${value} ] + ver_test \ + "${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}" \ + "${operator}" \ + "${1:-${KV_MAJOR}}.${2:-${KV_MINOR}}.${3:-${KV_PATCH}}" } # Capture the sources type and set DEPENDs