commit:     5a4698360bf370fbacf9553208f359b660ce5a66
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu Jun  5 02:59:42 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun  5 03:07:41 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a469836

90gcc-warnings: de-deduplicate non-adjacent warnings

Presently, the 90gcc-warnings QA check uses uniq(1) to de-duplicate the
collected warnings. In doing so, it requires for duplicate lines to be
adjacent to one another in order to be effective. However, this will not
necessarily be the case. Instead, use awk(1) to de-duplicate the
warnings while preserving their original order.

Bug: https://bugs.gentoo.org/832138
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/install-qa-check.d/90gcc-warnings 
b/bin/install-qa-check.d/90gcc-warnings
index 691a97f93f..f138fe90df 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -170,7 +170,7 @@ gcc_warn_check() {
                fi \
                | sed -E -e $'s/\033\[[0-9;]*[A-Za-z]//g' \
                | grep -E -a "warning: (${patterns[*]})" \
-               | uniq
+               | awk '!seen[$0]++'
        )
 
        if (( i > 0 )); then

Reply via email to