aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2023-09-22 00:22:00 +0200
committerMagnus Granberg <zorry@gentoo.org>2023-09-22 00:22:00 +0200
commitd35e389caa0fe40ffaf6ec8e6e460148716ed092 (patch)
treeb10c0fafaff78d9f4f46e914fb0816d7b22a9c29 /buildbot_gentoo_ci/utils/regex.py
parentCheck issue titel nice (diff)
downloadtinderbox-cluster-d35e389caa0fe40ffaf6ec8e6e460148716ed092.tar.gz
tinderbox-cluster-d35e389caa0fe40ffaf6ec8e6e460148716ed092.tar.bz2
tinderbox-cluster-d35e389caa0fe40ffaf6ec8e6e460148716ed092.zip
Move nice regex's to a file
Signed-off-by: Magnus Granberg <zorry@gentoo.org>
Diffstat (limited to 'buildbot_gentoo_ci/utils/regex.py')
-rw-r--r--buildbot_gentoo_ci/utils/regex.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/buildbot_gentoo_ci/utils/regex.py b/buildbot_gentoo_ci/utils/regex.py
new file mode 100644
index 0000000..29372e0
--- /dev/null
+++ b/buildbot_gentoo_ci/utils/regex.py
@@ -0,0 +1,22 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+import re
+
+# https://github.com/toralf/tinderbox/blob/main/bin/job.sh#L12
+def stripQuotesAndMore(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)
+ 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('/'):
+ word = word.split('/')[-1]
+ word = re.sub(":\d+:\d+:", "", word)
+ return word