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 8C2F21580EB for ; Fri, 30 May 2025 08:15:01 +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 77B4D34318E for ; Fri, 30 May 2025 08:15:01 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 0C53E11047D; Fri, 30 May 2025 08:14:38 +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 F2EC711047D for ; Fri, 30 May 2025 08:14:37 +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 B15F6342F99 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 ABF212900 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.f22f2f6150b0d58eb85ad65e43cc7be4657c5c7a.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: f22f2f6150b0d58eb85ad65e43cc7be4657c5c7a 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: 1a34a3ba-bca2-4e5b-b86d-ecfb20cf5543 X-Archives-Hash: 2fc19c290bb2bd9695147d53c30a77dd commit: f22f2f6150b0d58eb85ad65e43cc7be4657c5c7a Author: Kerin Millar plushkava net> AuthorDate: Sat Jul 27 22:13:58 2024 +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=f22f2f61 phase-helpers.sh: don't declare _eapply_get_files() repeatedly Potentially declaring _eapply_get_files() multiple times within a loop is hardly worth the dubious distinction of not bothering to declare at all in the case that no directory is seen. Hoist the declaration upwards so that it is declared early in eapply(), just as _eapply_patch() already is. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/phase-helpers.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index eca0a08c19..726e743f0a 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -991,6 +991,16 @@ if ___eapi_has_eapply; then # for bsd userland support, use gpatch if available type -P gpatch > /dev/null && patch_cmd=gpatch + _eapply_get_files() { + local LC_ALL=POSIX + local f + for f in "${1}"/*; do + if [[ ${f} == *.@(diff|patch) ]]; then + files+=( "${f}" ) + fi + done + } + _eapply_patch() { local f=${1} local prefix=${2} @@ -1056,16 +1066,6 @@ if ___eapi_has_eapply; then local f for f in "${files[@]}"; do if [[ -d ${f} ]]; then - _eapply_get_files() { - local LC_ALL=POSIX - local f - for f in "${1}"/*; do - if [[ ${f} == *.@(diff|patch) ]]; then - files+=( "${f}" ) - fi - done - } - local files=() _eapply_get_files "${f}" [[ ${#files[@]} -eq 0 ]] && die "No *.{patch,diff} files in directory ${f}"