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 DE3CD15807A for ; Mon, 09 Jun 2025 02:51:40 +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 C9349343172 for ; Mon, 09 Jun 2025 02:51:40 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 13B6C11049F; Mon, 09 Jun 2025 02:51:29 +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 0A857110497 for ; Mon, 09 Jun 2025 02:51:29 +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 B6E11343090 for ; Mon, 09 Jun 2025 02:51:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2D4422987 for ; Mon, 09 Jun 2025 02:51:26 +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: <1749437470.ed55f50d25cb1360318ce4b09dacb896f053c75b.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: ed55f50d25cb1360318ce4b09dacb896f053c75b X-VCS-Branch: master Date: Mon, 09 Jun 2025 02:51:26 +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: d4a410be-ece7-438e-bfee-29aa8ef6b377 X-Archives-Hash: 02ef815483024b2ffca863fcdad410de commit: ed55f50d25cb1360318ce4b09dacb896f053c75b Author: Kerin Millar plushkava net> AuthorDate: Sun Jun 8 17:04:04 2025 +0000 Commit: Sam James gentoo org> CommitDate: Mon Jun 9 02:51:10 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ed55f50d ecompress: rename several variables in do_queue() Rename the 'collisions' variable to 'collision_by' so as to emphasise that it is a map and not a list. Also, have its values be the null string rather than "1", thereby saving a little memory. Rename the 'vpath' variable to 'uncompressed_path', and the 'comp' variable to 'suffix'. These new names better convey their respective purposes. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ecompress | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/ecompress b/bin/ecompress index 9d8f8f3024..037e5b80df 100755 --- a/bin/ecompress +++ b/bin/ecompress @@ -54,9 +54,9 @@ do_ignore() { } do_queue() { - local vpath comp path + local uncompressed_path suffix path local -a find_args paths - local -A collisions + local -A collision_by for path; do if [[ ${path} == *$'\n'* ]]; then @@ -85,11 +85,11 @@ do_queue() { # note: to save time, we need to do this only if there's # at least one compressed file if [[ ${path} == *.@(Z|gz|bz2|lzma|lz|lzo|lz4|xz|zst) ]]; then - 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 + uncompressed_path=${path%.*} + for suffix in '' .{Z,gz,bz2,lzma,lz,lzo,lz4,xz,zst}; do + if [[ ${uncompressed_path}${suffix} != "${path}" && -e ${uncompressed_path}${suffix} ]]; then + collision_by[$path]= + collision_by[$uncompressed_path]= # ignore compressed variants in that case continue 2 fi @@ -105,10 +105,10 @@ do_queue() { # Check whether the invocation of find(1) succeeded. wait "$!" || die - if (( ${#collisions[@]} )); then + if (( ${#collision_by[@]} )); then eqawarn "QA Notice: Colliding files found by ecompress:" eqawarn - for path in "${!collisions[@]}"; do + for path in "${!collision_by[@]}"; do eqawarn " ${path}" done eqawarn