From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 526DD158014 for ; Sun, 29 Aug 2021 22:52:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECDCFE0855; Sun, 29 Aug 2021 22:52:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C31D0E0849 for ; Sun, 29 Aug 2021 22:52:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9CAB9335D7F for ; Sun, 29 Aug 2021 22:52:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 215C982 for ; Sun, 29 Aug 2021 22:52:31 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1630277457.6edd821aefef800ad5bb3aeccbc8e4fefe27bd20.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/linux-info.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 6edd821aefef800ad5bb3aeccbc8e4fefe27bd20 X-VCS-Branch: master Date: Sun, 29 Aug 2021 22:52:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 55bef829-713e-417c-95e8-715c90234601 X-Archives-Hash: 62aa7c9aa13217f021b573d73682e405 commit: 6edd821aefef800ad5bb3aeccbc8e4fefe27bd20 Author: Ulrich Müller gentoo org> AuthorDate: Sat Aug 28 05:25:48 2021 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Aug 29 22:50:57 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6edd821a linux-info.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 gentoo.org> eclass/linux-info.eclass | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 124fb70e78a..8edd17c317d 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -395,7 +395,7 @@ kernel_is() { linux-info_get_any_version # Now we can continue - local operator test value + local operator case ${1#-} in lt) operator="-lt"; shift;; @@ -407,9 +407,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}}" } get_localversion() {