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 B50E31580B9 for ; Fri, 27 Aug 2021 17:22:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EA97DE083E; Fri, 27 Aug 2021 17:22:07 +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 CE735E083E for ; Fri, 27 Aug 2021 17:22:07 +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 E718A342BD4 for ; Fri, 27 Aug 2021 17:22:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3F93F2C 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: <1630084895.1646e870d312060d7920869eec8416a8753724b6.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/kernel-2.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 1646e870d312060d7920869eec8416a8753724b6 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: fa36030b-2575-4fda-b1a1-58ca70390f6e X-Archives-Hash: dd4314a264ce4839835105d9d0889030 commit: 1646e870d312060d7920869eec8416a8753724b6 Author: Ulrich Müller gentoo org> AuthorDate: Thu Aug 26 09:20:04 2021 +0000 Commit: Ulrich Müller gentoo 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 gentoo.org> Signed-off-by: Ulrich Müller 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