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 7B00A15807A for ; Sat, 07 Jun 2025 22:54:55 +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 659723430F1 for ; Sat, 07 Jun 2025 22:54:55 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 19E1B11047D; Sat, 07 Jun 2025 22:54:47 +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 1533711047D for ; Sat, 07 Jun 2025 22:54:47 +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 BE8CD3430C8 for ; Sat, 07 Jun 2025 22:54:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2C89F290D for ; Sat, 07 Jun 2025 22:54:45 +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: <1749336848.dc83120e615f35e4cb44cd78930e4eb046288e02.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: dc83120e615f35e4cb44cd78930e4eb046288e02 X-VCS-Branch: master Date: Sat, 07 Jun 2025 22:54:45 +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: 7126dd5a-70f7-4892-b484-cb9979355f7d X-Archives-Hash: df9caaab862d683429ae3b9edbf8cd57 commit: dc83120e615f35e4cb44cd78930e4eb046288e02 Author: Kerin Millar plushkava net> AuthorDate: Thu Jun 5 13:50:24 2025 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 7 22:54:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=dc83120e ecompress: fix the indentation for do_queue() and do_commit() 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. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ecompress | 150 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/bin/ecompress b/bin/ecompress index cee4baf92b..1f7bc7be1c 100755 --- a/bin/ecompress +++ b/bin/ecompress @@ -5,88 +5,88 @@ source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 do_ignore() { - local -a skip_dirs - local skip - - > "${T}/.ecompress_skip_files" || die - for skip; do - if [[ -d ${ED%/}/${skip#/} ]]; then - skip_dirs+=( "${ED%/}/${skip#/}" ) - else - rm -f "${ED%/}/${skip#/}.ecompress" || die - printf -- '%s\n' "${EPREFIX}/${skip#/}" >> "${T}/.ecompress_skip_files" || die - fi - done - - if [[ ${#skip_dirs[@]} -gt 0 ]]; then - while read -r -d '' skip; do - skip=${skip%.ecompress} - printf -- '%s\n' "${skip#${D%/}}" >> "${T}/.ecompress_skip_files" || die - done < <(find "${skip_dirs[@]}" -name '*.ecompress' -print0 -delete || die) + local -a skip_dirs + local skip + + > "${T}/.ecompress_skip_files" || die + for skip; do + if [[ -d ${ED%/}/${skip#/} ]]; then + skip_dirs+=( "${ED%/}/${skip#/}" ) + else + rm -f "${ED%/}/${skip#/}.ecompress" || die + printf -- '%s\n' "${EPREFIX}/${skip#/}" >> "${T}/.ecompress_skip_files" || die fi + done - if [[ -s ${T}/.ecompress_skip_files && -s ${T}/.ecompress_had_precompressed ]]; then - # Filter skipped files from ${T}/.ecompress_had_precompressed, - # using temporary files since these lists can be extremely large. - LC_COLLATE=C sort -u "${T}/.ecompress_skip_files" > "${T}/.ecompress_skip_files_sorted" || die - LC_COLLATE=C sort -u "${T}/.ecompress_had_precompressed" > "${T}/.ecompress_had_precompressed_sorted" || die - LC_COLLATE=C comm -13 "${T}/.ecompress_skip_files_sorted" "${T}/.ecompress_had_precompressed_sorted" > "${T}/.ecompress_had_precompressed" || die - rm -f "${T}/.ecompress_had_precompressed_sorted" "${T}/.ecompress_skip_files"{,_sorted} - fi + if [[ ${#skip_dirs[@]} -gt 0 ]]; then + while read -r -d '' skip; do + skip=${skip%.ecompress} + printf -- '%s\n' "${skip#${D%/}}" >> "${T}/.ecompress_skip_files" || die + done < <(find "${skip_dirs[@]}" -name '*.ecompress' -print0 -delete || die) + fi + + if [[ -s ${T}/.ecompress_skip_files && -s ${T}/.ecompress_had_precompressed ]]; then + # Filter skipped files from ${T}/.ecompress_had_precompressed, + # using temporary files since these lists can be extremely large. + LC_COLLATE=C sort -u "${T}/.ecompress_skip_files" > "${T}/.ecompress_skip_files_sorted" || die + LC_COLLATE=C sort -u "${T}/.ecompress_had_precompressed" > "${T}/.ecompress_had_precompressed_sorted" || die + LC_COLLATE=C comm -13 "${T}/.ecompress_skip_files_sorted" "${T}/.ecompress_had_precompressed_sorted" > "${T}/.ecompress_had_precompressed" || die + rm -f "${T}/.ecompress_had_precompressed_sorted" "${T}/.ecompress_skip_files"{,_sorted} + fi } do_queue() { - local vpath comp path x - local -A collisions - local -a find_args + local vpath comp path x + local -A collisions + local -a find_args - for path; do - if [[ -e ${ED%/}/${path#/} ]]; then - find_args+=( "${ED%/}/${path#/}" ) - fi - done - - if [[ ${#find_args[@]} -gt 0 ]]; then - find_args+=( -type f ) - [[ -n ${PORTAGE_DOCOMPRESS_SIZE_LIMIT} ]] && - find_args+=( -size "+${PORTAGE_DOCOMPRESS_SIZE_LIMIT}c" ) - - while IFS= read -d '' -r path; do - # detect the horrible posibility of the ebuild installing - # colliding compressed and/or uncompressed variants - # and fail hard (bug #667072) - # - # 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%/}}" >> "${T}"/.ecompress_had_precompressed || die - ;; - esac - - >> "${path}.ecompress" || die - done < <(find "${find_args[@]}" -print0 || die) - - if [[ ${#collisions[@]} -gt 0 ]]; then - eqawarn "QA Notice: Colliding files found by ecompress:" - eqawarn - for x in "${!collisions[@]}"; do - eqawarn " ${x}" - done - eqawarn - eqawarn "Please remove the extraneous compressed variants." - fi + for path; do + if [[ -e ${ED%/}/${path#/} ]]; then + find_args+=( "${ED%/}/${path#/}" ) + fi + done + + if [[ ${#find_args[@]} -gt 0 ]]; then + find_args+=( -type f ) + [[ -n ${PORTAGE_DOCOMPRESS_SIZE_LIMIT} ]] && + find_args+=( -size "+${PORTAGE_DOCOMPRESS_SIZE_LIMIT}c" ) + + while IFS= read -d '' -r path; do + # detect the horrible posibility of the ebuild installing + # colliding compressed and/or uncompressed variants + # and fail hard (bug #667072) + # + # 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%/}}" >> "${T}"/.ecompress_had_precompressed || die + ;; + esac + + >> "${path}.ecompress" || die + done < <(find "${find_args[@]}" -print0 || die) + + if [[ ${#collisions[@]} -gt 0 ]]; then + eqawarn "QA Notice: Colliding files found by ecompress:" + eqawarn + for x in "${!collisions[@]}"; do + eqawarn " ${x}" + done + eqawarn + eqawarn "Please remove the extraneous compressed variants." fi + fi } guess_suffix() {