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 6522615807A for ; Sat, 07 Jun 2025 22:55:23 +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 510B1343141 for ; Sat, 07 Jun 2025 22:55:23 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2D5D41104BC; Sat, 07 Jun 2025 22:54:50 +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 216781104BC for ; Sat, 07 Jun 2025 22:54:50 +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 CE67C34310C for ; Sat, 07 Jun 2025 22:54:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 01A6F27EA for ; Sat, 07 Jun 2025 22:54:47 +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: <1749336855.99d2d256525e79728ad7dc1431f5e909460f9f8b.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: 99d2d256525e79728ad7dc1431f5e909460f9f8b X-VCS-Branch: master Date: Sat, 07 Jun 2025 22:54:47 +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: ea0700df-9a18-4984-a852-d6d480002323 X-Archives-Hash: 7c73d44d4d593d435bb9cfcd0b4f1878 commit: 99d2d256525e79728ad7dc1431f5e909460f9f8b Author: Kerin Millar plushkava net> AuthorDate: Sat Jun 7 18:14:16 2025 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 7 22:54:15 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=99d2d256 ecompress: rename several variables in fix_symlinks() As regards the fix_symlinks() function, rename the 'brokenlink' variable to 'link', the 'olddest' variable to 'target1', and the 'newdest' variable to 'target2'. Following this change, I find the code slightly easier to follow at a glance. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ecompress | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/ecompress b/bin/ecompress index 7e13c182f4..e77347eed5 100755 --- a/bin/ecompress +++ b/bin/ecompress @@ -132,26 +132,26 @@ guess_suffix() { } fix_symlinks() { - local something_changed brokenlink newdest olddest i + local something_changed link target1 target2 i # Repeat until nothing changes, in order to handle multiple # levels of indirection (see bug #470916). while true ; do something_changed=0 - while IFS= read -rd '' brokenlink; do - [[ -e ${brokenlink} ]] && continue + while IFS= read -rd '' link; do + [[ -e ${link} ]] && continue - olddest=$(readlink -- "${brokenlink}") - newdest=${olddest}${PORTAGE_COMPRESS_SUFFIX} - if [[ "${newdest}" == /* ]] ; then - [[ -f "${D%/}${newdest}" ]] || continue + target1=$(readlink -- "${link}") + target2=${target1}${PORTAGE_COMPRESS_SUFFIX} + if [[ "${target2}" == /* ]] ; then + [[ -f "${D%/}${target2}" ]] || continue else - [[ -f "${brokenlink%/*}/${newdest}" ]] || continue + [[ -f "${link%/*}/${target2}" ]] || continue fi something_changed=1 - rm -f -- "${brokenlink}" \ - && ln -snf -- "${newdest}" "${brokenlink}${PORTAGE_COMPRESS_SUFFIX}" \ + rm -f -- "${link}" \ + && ln -snf -- "${target2}" "${link}${PORTAGE_COMPRESS_SUFFIX}" \ || return done < <(printf '%s\0' "${ED}" | find0 -type l -print0)