aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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