Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/
Date: Fri, 26 Sep 2014 02:17:27
Message-Id: 1411694533.0f245b5f6d32c6bb10f59071e8bff8193a08b85a.dol-sen@gentoo
1 commit: 0f245b5f6d32c6bb10f59071e8bff8193a08b85a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 12 11:38:07 2014 +0000
4 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
5 CommitDate: Fri Sep 26 01:22:13 2014 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f245b5f
7
8 Use a single grep call for gcc warning checks
9
10 Use a single grep call with all gcc warning checks combined rather than
11 calling grep separately for each message being checked. Aside to being
12 faster, this also avoids outputting warnings in separate blocks.
13
14 ---
15 bin/install-qa-check.d/90gcc-warnings | 62 +++++++++++++++++++----------------
16 1 file changed, 33 insertions(+), 29 deletions(-)
17
18 diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings
19 index 48c11e4..9703c39 100644
20 --- a/bin/install-qa-check.d/90gcc-warnings
21 +++ b/bin/install-qa-check.d/90gcc-warnings
22 @@ -71,39 +71,43 @@ gcc_warn_check() {
23 #': warning: missing sentinel in function call'
24 #': warning: not enough variable arguments to fit a sentinel'
25 )
26 +
27 + # join all messages into one grep-expression
28 + local joined_msgs
29 + printf -v joined_msgs '%s|' "${msgs[@]}"
30 + joined_msgs=${joined_msgs%|}
31 +
32 local abort="no"
33 - local i=0
34 local grep_cmd=grep
35 [[ $PORTAGE_LOG_FILE = *.gz ]] && grep_cmd=zgrep
36 - while [[ -n ${msgs[${i}]} ]] ; do
37 - m=${msgs[$((i++))]}
38 - # force C locale to work around slow unicode locales #160234
39 - f=$(LC_ALL=C $grep_cmd "${m}" "${PORTAGE_LOG_FILE}")
40 - if [[ -n ${f} ]] ; then
41 - abort="yes"
42 - # for now, don't make this fatal (see bug #337031)
43 - #case "$m" in
44 - # ": warning: call to .* will always overflow destination buffer") always_overflow=yes ;;
45 - #esac
46 - if [[ $always_overflow = yes ]] ; then
47 - eerror
48 - eerror "QA Notice: Package triggers severe warnings which indicate that it"
49 - eerror " may exhibit random runtime failures."
50 - eerror
51 - eerror "${f}"
52 - eerror
53 - eerror " Please file a bug about this at http://bugs.gentoo.org/"
54 - eerror " with the maintaining herd of the package."
55 - eerror
56 - else
57 - __vecho -ne '\n'
58 - eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
59 - eqawarn " may exhibit random runtime failures."
60 - eqawarn "${f}"
61 - __vecho -ne '\n'
62 - fi
63 +
64 + # force C locale to work around slow unicode locales #160234
65 + f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E "${joined_msgs}" "${PORTAGE_LOG_FILE}")
66 + if [[ -n ${f} ]] ; then
67 + abort="yes"
68 + # for now, don't make this fatal (see bug #337031)
69 + #if [[ ${f} == *'will always overflow destination buffer'* ]]; then
70 + # always_overflow=yes
71 + #fi
72 + if [[ $always_overflow = yes ]] ; then
73 + eerror
74 + eerror "QA Notice: Package triggers severe warnings which indicate that it"
75 + eerror " may exhibit random runtime failures."
76 + eerror
77 + eerror "${f}"
78 + eerror
79 + eerror " Please file a bug about this at http://bugs.gentoo.org/"
80 + eerror " with the maintaining herd of the package."
81 + eerror
82 + else
83 + __vecho -ne '\n'
84 + eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
85 + eqawarn " may exhibit random runtime failures."
86 + eqawarn "${f}"
87 + __vecho -ne '\n'
88 fi
89 - done
90 + fi
91 +
92 local cat_cmd=cat
93 [[ $PORTAGE_LOG_FILE = *.gz ]] && cat_cmd=zcat
94 [[ $reset_debug = 1 ]] && set -x