From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 595221580EB for ; Fri, 30 May 2025 08:15:04 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 3B233343096 for ; Fri, 30 May 2025 08:15:04 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 24C881104BC; Fri, 30 May 2025 08:14:38 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1A9B01104BC for ; Fri, 30 May 2025 08:14:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CC18F3430BD for ; Fri, 30 May 2025 08:14:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E207628BB for ; Fri, 30 May 2025 08:14:34 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1748592865.234904f6b10bddd93d63c4886099f89860694ca0.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-helpers.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 234904f6b10bddd93d63c4886099f89860694ca0 X-VCS-Branch: master Date: Fri, 30 May 2025 08:14:34 +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: 7e3ad932-d992-4cf5-9096-e32658f1491e X-Archives-Hash: b70fa5123211242b655dab83f191236f commit: 234904f6b10bddd93d63c4886099f89860694ca0 Author: Kerin Millar plushkava net> AuthorDate: Mon May 26 10:02:13 2025 +0000 Commit: Sam James gentoo org> CommitDate: Fri May 30 08:14:25 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=234904f6 phase-helpers.sh: clean up the handling of suffix_known Treat the 'suffix_known' variable as a quasi-boolean by evaluating it in the arithmetic context. Further, do away with the multitude of variable assignments by assessing the exit status of the case command itself. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/phase-helpers.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 1949230c09..7ae983ccb7 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -401,22 +401,22 @@ unpack() { die "unpack: ${f@Q} cannot be unpacked because it is an empty file" fi - suffix_known="" case ${suffix,,} in - tar|tgz|tbz2|tbz|zip|jar|gz|z|bz2|bz|a|deb|lzma) suffix_known=1 ;; - 7z) ___eapi_unpack_supports_7z && suffix_known=1 ;; - rar) ___eapi_unpack_supports_rar && suffix_known=1 ;; - lha|lzh) ___eapi_unpack_supports_lha && suffix_known=1 ;; - xz) ___eapi_unpack_supports_xz && suffix_known=1 ;; - txz) ___eapi_unpack_supports_txz && suffix_known=1 ;; - esac - - if ___eapi_unpack_is_case_sensitive \ - && [[ ${suffix} != @("${suffix,,}"|ZIP|Z|7Z|RAR|LH[Aa]) ]]; then - suffix_known="" - fi - - if [[ -n ${suffix_known} ]]; then + tar|tgz|tbz2|tbz|zip|jar|gz|z|bz2|bz|a|deb|lzma) ;; + 7z) ___eapi_unpack_supports_7z ;; + rar) ___eapi_unpack_supports_rar ;; + lha|lzh) ___eapi_unpack_supports_lha ;; + xz) ___eapi_unpack_supports_xz ;; + txz) ___eapi_unpack_supports_txz ;; + *) false ;; + esac \ + && suffix_known=1 + + ___eapi_unpack_is_case_sensitive \ + && [[ ${suffix} != @("${suffix,,}"|ZIP|Z|7Z|RAR|LH[Aa]) ]] \ + && suffix_known=0 + + if (( suffix_known )); then __vecho ">>> Unpacking ${f@Q} to ${PWD}" else __vecho "=== Skipping unpack of ${f@Q}"