aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@gentoo.org>2024-07-22 19:19:19 -0400
committerSam James <sam@gentoo.org>2024-09-10 00:48:44 +0100
commitb78da6155975faa519f93ec0bebe9830dd265c09 (patch)
treebad5a2ca499eb020be4686131ba8c188fd737288
parenteapi.py: Use attrs instead of hardcoding EAPIs in functions (diff)
downloadportage-b78da6155975faa519f93ec0bebe9830dd265c09.tar.gz
portage-b78da6155975faa519f93ec0bebe9830dd265c09.tar.bz2
portage-b78da6155975faa519f93ec0bebe9830dd265c09.zip
install-qa-check.d: try to detect gcc warnings past color
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 <eschwartz@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1375 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--bin/install-qa-check.d/90gcc-warnings2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings
index 2e728268e..c7e3d6a8a 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -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"