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 6A99815807A for ; Sat, 07 Jun 2025 22:54:56 +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 5526C34311C for ; Sat, 07 Jun 2025 22:54:56 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 6460311047E; Sat, 07 Jun 2025 22:54:48 +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 5CFD811047E for ; Sat, 07 Jun 2025 22:54:48 +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 169C2342FAF for ; Sat, 07 Jun 2025 22:54:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 60BE9291E 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: <1749336849.22d9708b658fd1b951e14a5f77b77cb07c2b7ad4.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: 22d9708b658fd1b951e14a5f77b77cb07c2b7ad4 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: 090a0afa-3a27-4432-9938-7e215e43b1ec X-Archives-Hash: 23ca938066eb3de128fc4dd44bb5bbde commit: 22d9708b658fd1b951e14a5f77b77cb07c2b7ad4 Author: Kerin Millar plushkava net> AuthorDate: Wed Aug 10 23:38:20 2022 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 7 22:54:09 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=22d9708b ecompress: routinely employ -- to signify end of options Specify the "--" operand to the comm(1), ln(1), mkdir(1), readlink(1), rm(1) and sort(1) utilities, signifying where options end. Likewise for the cd builtin. Also, refrain from specifying "--" to the printf ebuiltin superfluously. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ecompress | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/ecompress b/bin/ecompress index aa237f7d67..f7efec24ed 100755 --- a/bin/ecompress +++ b/bin/ecompress @@ -13,25 +13,25 @@ do_ignore() { 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 + rm -f -- "${ED%/}/${skip#/}.ecompress" || die + printf '%s\n' "${EPREFIX}/${skip#/}" >> "${T}/.ecompress_skip_files" || die fi done if (( ${#skip_dirs[@]} )); then while read -r -d '' skip; do skip=${skip%.ecompress} - printf -- '%s\n' "${skip#${D%/}}" >> "${T}/.ecompress_skip_files" || die + 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} + 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 } @@ -70,7 +70,7 @@ do_queue() { continue 2 fi done - printf -- '%s\n' "${path#${D%/}}" >> "${T}"/.ecompress_had_precompressed || die + printf '%s\n' "${path#${D%/}}" >> "${T}"/.ecompress_had_precompressed || die ;; esac @@ -93,8 +93,8 @@ guess_suffix() { set -e tmpdir="${T}"/.ecompress$$.${RANDOM} - mkdir "${tmpdir}" - cd "${tmpdir}" + mkdir -- "${tmpdir}" + cd -- "${tmpdir}" # We have to fill the file enough so that there is something # to compress as some programs will refuse to do compression @@ -110,7 +110,7 @@ guess_suffix() { suffix=${suffix#compressme} cd / - rm -rf "${tmpdir}" + rm -rf -- "${tmpdir}" echo "${suffix}" } @@ -125,7 +125,7 @@ fix_symlinks() { while read -r -d $'\0' brokenlink ; do [[ -e ${brokenlink} ]] && continue - olddest=$(readlink "${brokenlink}") + olddest=$(readlink -- "${brokenlink}") newdest=${olddest}${PORTAGE_COMPRESS_SUFFIX} if [[ "${newdest}" == /* ]] ; then [[ -f "${D%/}${newdest}" ]] || continue @@ -134,8 +134,8 @@ fix_symlinks() { fi something_changed=1 - rm -f "${brokenlink}" && - ln -snf "${newdest}" "${brokenlink}${PORTAGE_COMPRESS_SUFFIX}" + rm -f -- "${brokenlink}" \ + && ln -snf -- "${newdest}" "${brokenlink}${PORTAGE_COMPRESS_SUFFIX}" ((ret|=$?)) done < <(find "${ED}" -type l -print0 || die)