aboutsummaryrefslogtreecommitdiff
blob: c8d19d06de257fe579f3f956f3b9956331001968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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):
    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):
    word2 = word
    # /usr/foo/baa/ghyk.c:67:69: -> ghyk.c:567:76:
    if '/' in word and word.endswith(':'):
        word = word.split('/')[-1]
    # 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