From 955e80294c70d1a47ab39b656e9d9357cf3f5f8d Mon Sep 17 00:00:00 2001 From: Magnus Granberg Date: Tue, 12 Mar 2024 21:39:02 +0100 Subject: Fix finishTitle for path regex Signed-off-by: Magnus Granberg --- buildbot_gentoo_ci/utils/regex.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/buildbot_gentoo_ci/utils/regex.py b/buildbot_gentoo_ci/utils/regex.py index 29372e0..c8d19d0 100644 --- a/buildbot_gentoo_ci/utils/regex.py +++ b/buildbot_gentoo_ci/utils/regex.py @@ -5,18 +5,25 @@ import re # https://github.com/toralf/tinderbox/blob/main/bin/job.sh#L12 def stripQuotesAndMore(word): + word2 = word word = re.sub(r"b'", "", word) word = re.sub(r"'", "", word) word = re.sub(r'`', '', word) word = re.sub(r'"', '', word) word = re.sub(r'\\', '', word) + print(f"Word: {word2} Finish Word: {word}") return word # strip away hex addresses, loong path names, line and time numbers and other stuff # https://github.com/toralf/tinderbox/blob/main/bin/job.sh#L469 # FIXME: Add the needed line when needed def finishTitle(word): - if word.startswith('/'): + word2 = word + # /usr/foo/baa/ghyk.c:67:69: -> ghyk.c:567:76: + if '/' in word and word.endswith(':'): word = word.split('/')[-1] - word = re.sub(":\d+:\d+:", "", word) + # ghyfv.v:78:9876: -> ghyfv.v + if word.endswith(':') and any(i.isdigit() for i in word): + word = word.split(':')[0] + print(f"Word: {word2} Finish Word: {word}") return word -- cgit v1.2.3-65-gdbad