Skip to content

Commit

Permalink
install-qa-check.d: try to detect gcc warnings past color
Browse files Browse the repository at this point in the history
We have some code we use for config-impl-decl which can strip color
codes out via sed. This is always necessary for config.log because if
color exists it will still be there.

The assumption was, likely, that build.log as managed by portage will
also be ansifilter'd by portage, and therefore stripping color is
unnecessary. But in fact, some people do like color and intentionally
avoid stripping it. This rendered the QA check effectively broken.
Instead we should make no assumptions, and explicitly strip this too.

Signed-off-by: Eli Schwartz <[email protected]>
Closes: #1375
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
eli-schwartz authored and thesamesam committed Sep 9, 2024
1 parent 492506a commit b78da61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/install-qa-check.d/90gcc-warnings
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ gcc_warn_check() {
# 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=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E -a "${joined_msgs}" "${PORTAGE_LOG_FILE}" | uniq)
f=$(LC_ALL='C' sed -E -e $'s/\033\[[0-9;]*[A-Za-z]//g' < "${PORTAGE_LOG_FILE}" | LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E -a "${joined_msgs}" | uniq)
if [[ -n ${f} ]] ; then
abort="yes"

Expand Down

0 comments on commit b78da61

Please sign in to comment.