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 9B4BA158041 for ; Wed, 11 Jun 2025 03:26:45 +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) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 51F15340DCC for ; Wed, 11 Jun 2025 03:26:45 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id C16DC1137F2; Wed, 11 Jun 2025 03:26:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 B62E81137F2 for ; Wed, 11 Jun 2025 03:26:32 +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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6BFA034027D for ; Wed, 11 Jun 2025 03:26:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B28B0265C for ; Wed, 11 Jun 2025 03:26:29 +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: <1749612378.8454ba2415fd1bd4acd4e34b66d97b18d4a3e9f3.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/estrip X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 8454ba2415fd1bd4acd4e34b66d97b18d4a3e9f3 X-VCS-Branch: master Date: Wed, 11 Jun 2025 03:26:29 +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: 6027832f-0e46-4c43-b946-49bb012bba4c X-Archives-Hash: d28e2ecfc9fab937f891a6ebea73c46c commit: 8454ba2415fd1bd4acd4e34b66d97b18d4a3e9f3 Author: Kerin Millar plushkava net> AuthorDate: Mon Jun 9 19:57:26 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 11 03:26:18 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8454ba24 estrip: fix the indentation for do_ignore() and do_queue() The preceding commit introduced two new functions, whose contents were deliberately over-indented so as to reduce the complexity of the patch. As such, this commit serves only to correct the indentation. See-also: dc83120e615f35e4cb44cd78930e4eb046288e02 Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/estrip | 124 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/bin/estrip b/bin/estrip index a149731b57..6a0fab2bda 100755 --- a/bin/estrip +++ b/bin/estrip @@ -325,76 +325,76 @@ restore_xattrs() { } do_ignore() { - local -a skip_dirs - local skip - - for skip; do - if [[ -d ${ED%/}/${skip#/} ]]; then - skip_dirs+=( "${ED%/}/${skip#/}" ) - else - rm -f "${ED%/}/${skip#/}.estrip" || die - fi - done + local -a skip_dirs + local skip - if (( ${#skip_dirs[@]} )); then - find "${skip_dirs[@]}" -name '*.estrip' -delete || die + for skip; do + if [[ -d ${ED%/}/${skip#/} ]]; then + skip_dirs+=( "${ED%/}/${skip#/}" ) + else + rm -f "${ED%/}/${skip#/}.estrip" || die fi + done + + if (( ${#skip_dirs[@]} )); then + find "${skip_dirs[@]}" -name '*.estrip' -delete || die + fi } do_queue() { - local needed_entry_file needed_entry find_path path - local -a find_paths scanelf_results - - for path; do - if [[ -e ${ED%/}/${path#/} ]]; then - find_paths+=( "${ED%/}/${path#/}" ) - fi - done + local needed_entry_file needed_entry find_path path + local -a find_paths scanelf_results - if (( ${#find_paths[@]} )); then - # We can avoid scanelf calls for binaries we already - # checked in install_qa_check (where we generate - # NEEDED for everything installed). - # - # EAPI 7+ has controlled stripping (dostrip) though - # which is why estrip has the queue/dequeue logic, - # so we need to take the intersection of: - # 1. files scanned earlier (all ELF installed) - # (note that this should be a superset of 2., so we don't - # need to worry about unknown files appearing) - # - # 2. the files we're interested in right now - if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then - # The arguments may not be exact files (probably aren't), but search paths/directories - # which should then be searched recursively. - while IFS= read -r needed_entry ; do - for find_path in "${find_paths[@]}" ; do - # NEEDED has a bunch of entries like: - # /usr/lib64/libfoo.so libc.so - # - # find_path entries may be exact paths (like /usr/lib64/libfoo.so) - # or instead /usr/lib64, or ${ED}/usr, etc. - # - # We check if the beginning (i.e. first entry) of the NEEDED line - # matches the path given - # e.g. find_path="/usr/lib64" will match needed_entry="/usr/lib64/libfoo.so libc.so". - needed_entry_file="${needed_entry% *}" - if [[ "${needed_entry_file}" =~ ^${find_path##"${D}"} ]] ; then - scanelf_results+=( "${D}${needed_entry_file}" ) - fi - done - done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED - else - mapfile -t scanelf_results < <(scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}") - fi + for path; do + if [[ -e ${ED%/}/${path#/} ]]; then + find_paths+=( "${ED%/}/${path#/}" ) + fi + done - while IFS= read -r path; do - >> "${path}.estrip" || die - done < <( - (( ${#scanelf_results[@]} )) && printf "%s\n" "${scanelf_results[@]}" - find "${find_paths[@]}" -type f ! -type l -name '*.a' - ) + if (( ${#find_paths[@]} )); then + # We can avoid scanelf calls for binaries we already + # checked in install_qa_check (where we generate + # NEEDED for everything installed). + # + # EAPI 7+ has controlled stripping (dostrip) though + # which is why estrip has the queue/dequeue logic, + # so we need to take the intersection of: + # 1. files scanned earlier (all ELF installed) + # (note that this should be a superset of 2., so we don't + # need to worry about unknown files appearing) + # + # 2. the files we're interested in right now + if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then + # The arguments may not be exact files (probably aren't), but search paths/directories + # which should then be searched recursively. + while IFS= read -r needed_entry ; do + for find_path in "${find_paths[@]}" ; do + # NEEDED has a bunch of entries like: + # /usr/lib64/libfoo.so libc.so + # + # find_path entries may be exact paths (like /usr/lib64/libfoo.so) + # or instead /usr/lib64, or ${ED}/usr, etc. + # + # We check if the beginning (i.e. first entry) of the NEEDED line + # matches the path given + # e.g. find_path="/usr/lib64" will match needed_entry="/usr/lib64/libfoo.so libc.so". + needed_entry_file="${needed_entry% *}" + if [[ "${needed_entry_file}" =~ ^${find_path##"${D}"} ]] ; then + scanelf_results+=( "${D}${needed_entry_file}" ) + fi + done + done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED + else + mapfile -t scanelf_results < <(scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}") fi + + while IFS= read -r path; do + >> "${path}.estrip" || die + done < <( + (( ${#scanelf_results[@]} )) && printf "%s\n" "${scanelf_results[@]}" + find "${find_paths[@]}" -type f ! -type l -name '*.a' + ) + fi } declare -A has_feature