From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E7CC513838B for ; Fri, 26 Sep 2014 02:17:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0C0ADE0AE6; Fri, 26 Sep 2014 02:17:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 89570E0AE6 for ; Fri, 26 Sep 2014 02:17:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 003553401E6 for ; Fri, 26 Sep 2014 02:17:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 363096477 for ; Fri, 26 Sep 2014 02:17:21 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1411694533.0f245b5f6d32c6bb10f59071e8bff8193a08b85a.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/ X-VCS-Repository: proj/portage X-VCS-Files: bin/install-qa-check.d/90gcc-warnings X-VCS-Directories: bin/install-qa-check.d/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 0f245b5f6d32c6bb10f59071e8bff8193a08b85a X-VCS-Branch: master Date: Fri, 26 Sep 2014 02:17:21 +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-Archives-Salt: 984cd91d-3c8d-470c-abab-38fdcae96cb3 X-Archives-Hash: cafc189569b37e132e7b90efcfcc4352 commit: 0f245b5f6d32c6bb10f59071e8bff8193a08b85a Author: Michał Górny gentoo org> AuthorDate: Fri Sep 12 11:38:07 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Fri Sep 26 01:22:13 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f245b5f Use a single grep call for gcc warning checks Use a single grep call with all gcc warning checks combined rather than calling grep separately for each message being checked. Aside to being faster, this also avoids outputting warnings in separate blocks. --- bin/install-qa-check.d/90gcc-warnings | 62 +++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings index 48c11e4..9703c39 100644 --- a/bin/install-qa-check.d/90gcc-warnings +++ b/bin/install-qa-check.d/90gcc-warnings @@ -71,39 +71,43 @@ gcc_warn_check() { #': warning: missing sentinel in function call' #': warning: not enough variable arguments to fit a sentinel' ) + + # join all messages into one grep-expression + local joined_msgs + printf -v joined_msgs '%s|' "${msgs[@]}" + joined_msgs=${joined_msgs%|} + local abort="no" - local i=0 local grep_cmd=grep [[ $PORTAGE_LOG_FILE = *.gz ]] && grep_cmd=zgrep - while [[ -n ${msgs[${i}]} ]] ; do - m=${msgs[$((i++))]} - # force C locale to work around slow unicode locales #160234 - f=$(LC_ALL=C $grep_cmd "${m}" "${PORTAGE_LOG_FILE}") - if [[ -n ${f} ]] ; then - abort="yes" - # for now, don't make this fatal (see bug #337031) - #case "$m" in - # ": warning: call to .* will always overflow destination buffer") always_overflow=yes ;; - #esac - if [[ $always_overflow = yes ]] ; then - eerror - eerror "QA Notice: Package triggers severe warnings which indicate that it" - eerror " may exhibit random runtime failures." - eerror - eerror "${f}" - eerror - eerror " Please file a bug about this at http://bugs.gentoo.org/" - eerror " with the maintaining herd of the package." - eerror - else - __vecho -ne '\n' - eqawarn "QA Notice: Package triggers severe warnings which indicate that it" - eqawarn " may exhibit random runtime failures." - eqawarn "${f}" - __vecho -ne '\n' - fi + + # force C locale to work around slow unicode locales #160234 + f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E "${joined_msgs}" "${PORTAGE_LOG_FILE}") + if [[ -n ${f} ]] ; then + abort="yes" + # for now, don't make this fatal (see bug #337031) + #if [[ ${f} == *'will always overflow destination buffer'* ]]; then + # always_overflow=yes + #fi + if [[ $always_overflow = yes ]] ; then + eerror + eerror "QA Notice: Package triggers severe warnings which indicate that it" + eerror " may exhibit random runtime failures." + eerror + eerror "${f}" + eerror + eerror " Please file a bug about this at http://bugs.gentoo.org/" + eerror " with the maintaining herd of the package." + eerror + else + __vecho -ne '\n' + eqawarn "QA Notice: Package triggers severe warnings which indicate that it" + eqawarn " may exhibit random runtime failures." + eqawarn "${f}" + __vecho -ne '\n' fi - done + fi + local cat_cmd=cat [[ $PORTAGE_LOG_FILE = *.gz ]] && cat_cmd=zcat [[ $reset_debug = 1 ]] && set -x