commit:     955e80294c70d1a47ab39b656e9d9357cf3f5f8d
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 20:39:02 2024 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 20:39:02 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=955e8029

Fix finishTitle for path regex

Signed-off-by: Magnus Granberg <zorry <AT> gentoo.org>

 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

Reply via email to