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 2685F1580B9 for ; Fri, 27 Aug 2021 17:22:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BDABE084A; Fri, 27 Aug 2021 17:22:08 +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 395A9E084A for ; Fri, 27 Aug 2021 17:22:08 +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 29C6E342C2B for ; Fri, 27 Aug 2021 17:22:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7068456 for ; Fri, 27 Aug 2021 17:22:05 +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: <1630084897.4b48b038fa23b5580fa2b916b34c646c155db93a.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: 4b48b038fa23b5580fa2b916b34c646c155db93a X-VCS-Branch: master Date: Fri, 27 Aug 2021 17:22:05 +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: 01817aef-98e2-4f3b-8aa5-50e03b5f37f6 X-Archives-Hash: 521744bb163a2cff9f7cde0bb08e2df8 commit: 4b48b038fa23b5580fa2b916b34c646c155db93a Author: Ulrich Müller gentoo org> AuthorDate: Thu Aug 26 09:21:17 2021 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Fri Aug 27 17:21:37 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b48b038 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. Reviewed-by: Alice Ferrazzi gentoo.org> 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..5456d6be02e 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}.${KV_MINOR}.${KV_PATCH}" \ + "${operator}" \ + "${1:-${KV_MAJOR}}.${2:-${KV_MINOR}}.${3:-${KV_PATCH}}" } get_localversion() {