diff options
author | Ulrich Müller <ulm@gentoo.org> | 2021-08-28 07:25:20 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2021-08-30 00:50:56 +0200 |
commit | 04449756186ef0196fe9eecb3f516d498ac08ec3 (patch) | |
tree | 5111dffb95c5f6c775328a02fefec3ba2151a0cf /eclass/kernel-2.eclass | |
parent | sci-geosciences/josm: josm now uses a svg icon (diff) | |
download | gentoo-04449756186ef0196fe9eecb3f516d498ac08ec3.tar.gz gentoo-04449756186ef0196fe9eecb3f516d498ac08ec3.tar.bz2 gentoo-04449756186ef0196fe9eecb3f516d498ac08ec3.zip |
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.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass/kernel-2.eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 8c1740998272..05c07c4d153e 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -560,7 +560,7 @@ kernel_is() { [[ ${n} -eq 1 ]] && detect_version # Now we can continue - local operator test value + local operator case ${1#-} in lt) operator="-lt"; shift;; @@ -572,9 +572,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:-0}.${KV_MINOR:-0}.${KV_PATCH:-0}" \ + "${operator}" \ + "${1:-${KV_MAJOR:-0}}.${2:-${KV_MINOR:-0}}.${3:-${KV_PATCH:-0}}" } # Capture the sources type and set DEPENDs |