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 22FA715807A for ; Mon, 09 Jun 2025 02:51:36 +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 0C84C343155 for ; Mon, 09 Jun 2025 02:51:36 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id C523511047D; Mon, 09 Jun 2025 02:51:27 +0000 (UTC) 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 bobolink.gentoo.org (Postfix) with ESMTPS id BB11D11047D for ; Mon, 09 Jun 2025 02:51:27 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7288A343081 for ; Mon, 09 Jun 2025 02:51:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D79DA2983 for ; Mon, 09 Jun 2025 02:51:25 +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: <1749437468.e1350e68e944ea2b8972f1303635a29c7f77c05d.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ecompress X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: e1350e68e944ea2b8972f1303635a29c7f77c05d X-VCS-Branch: master Date: Mon, 09 Jun 2025 02:51:25 +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: d893f3d8-0436-4799-99c4-ffe825eb7a86 X-Archives-Hash: 408e658cc9ec14e0452167f67b212d39 commit: e1350e68e944ea2b8972f1303635a29c7f77c05d Author: Kerin Millar plushkava net> AuthorDate: Sun Jun 8 16:51:27 2025 +0000 Commit: Sam James gentoo org> CommitDate: Mon Jun 9 02:51:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e1350e68 ecompress: reduce the degree of indentation in do_queue() Though some minor refactoring, reduce the maximal degree of indentation reached by the do_queue() function. As much as I like structured code, it was going a little overboard. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ecompress | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/bin/ecompress b/bin/ecompress index 3266c1c735..20415bd872 100755 --- a/bin/ecompress +++ b/bin/ecompress @@ -83,21 +83,19 @@ do_queue() { # # note: to save time, we need to do this only if there's # at least one compressed file - case ${path} in - *.Z|*.gz|*.bz2|*.lzma|.lz|.lzo|.lz4|*.xz|*.zst) - vpath=${path%.*} - for comp in '' .Z .gz .bz2 .lzma .lz .lzo .lz4 .xz .zst; do - if [[ ${vpath}${comp} != "${path}" && \ - -e ${vpath}${comp} ]]; then - collisions[${path}]=1 - collisions[${vpath}]=1 - # ignore compressed variants in that case - continue 2 - fi - done - printf '%s\n' "${path#"${D%/}"}" || ! break - ;; - esac + if [[ ${path} != *.@(Z|gz|bz2|lzma|lz|lzo|lz4|xz|zst) ]]; then + continue + fi + vpath=${path%.*} + for comp in '' .{Z,gz,bz2,lzma,lz,lzo,lz4,xz,zst}; do + if [[ ${vpath}${comp} != "${path}" && -e ${vpath}${comp} ]]; then + collisions[$path]=1 + collisions[$vpath]=1 + # ignore compressed variants in that case + continue 2 + fi + done + printf '%s\n' "${path#"${D%/}"}" || ! break : >> "${path}.ecompress" || die done \