commit:     fe82ae7743602aec01c69d5b3ed814c6edb11742
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu May 22 20:13:57 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 30 07:37:31 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fe82ae77

90gcc-warnings: jettison the joined_msgs variable

In the course of joining the patterns to form an ERE branch, there is no
need for an additional variable to store it.

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

 bin/install-qa-check.d/90gcc-warnings | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/bin/install-qa-check.d/90gcc-warnings 
b/bin/install-qa-check.d/90gcc-warnings
index 9ec16f1585..185deaa53a 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -3,7 +3,7 @@
 # TODO: add -Wformat-security
 
 gcc_warn_check() {
-        local abort f joined_msgs reset_xtrace
+        local abort f reset_xtrace
         local -a msgs
 
        # Evaluate misc gcc warnings
@@ -147,21 +147,18 @@ gcc_warn_check() {
                #': warning: not enough variable arguments to fit a sentinel'
        )
 
-       # join all messages into one grep-expression
-       printf -v joined_msgs '%s|' "${msgs[@]}"
-       joined_msgs=${joined_msgs%|}
-
        # Force C locale to work around slow multibyte locales, bug #160234
        # Force text mode as newer grep will treat non-ASCII (e.g. UTF-8) as
        # binary when we run in the C locale.
        f=$(
+               IFS='|'
                if [[ ${PORTAGE_LOG_FILE} == *.gz ]]; then
                        gzip -cd -- "${PORTAGE_LOG_FILE}"
                else
                        cat -- "${PORTAGE_LOG_FILE}"
                fi \
                | LC_ALL=C sed -E -e $'s/\033\[[0-9;]*[A-Za-z]//g' \
-               | LC_CTYPE=C LC_COLLATE=C grep -E -a "${joined_msgs}" \
+               | LC_CTYPE=C LC_COLLATE=C grep -E -a "${msgs[*]}" \
                | uniq
        )
        if [[ -n ${f} ]] ; then

Reply via email to