commit:     97f687702986db8ffc5e420a361d702d0b6dc2cb
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Jun  9 08:35:18 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 11 03:26:15 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=97f68770

ecompress: sort colliding pathnames in QA warning

Where the do_queue() function determines that there are any colliding
pathnames, lexicographically sort them at the point of conveying them
with eqawarn().

Further, employ the ${param@Q} form of expansion so as to ensure that
all pathnames are legible, and that control characters and (some)
whitespace characters are not printed in their raw form. Doing so is
acceptable, given a target of >=bash-4.4.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/ecompress | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/ecompress b/bin/ecompress
index 345b625ab8..1169255674 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -108,9 +108,9 @@ do_queue() {
        if (( ${#collision_by[@]} )); then
                eqawarn "QA Notice: Colliding files found by ecompress:"
                eqawarn
-               for path in "${!collision_by[@]}"; do
-                       eqawarn "  ${path}"
-               done
+               while IFS= read -r path; do
+                       eqawarn "  ${path@Q}"
+               done < <(printf '%s\n' "${!collision_by[@]}" | sort)
                eqawarn
                eqawarn "Please remove the extraneous compressed variants."
        fi

Reply via email to