Skip to content

Commit

Permalink
spears: Strip out hardcoded references to buildd.d.o
Browse files Browse the repository at this point in the history
Resolves: #28
  • Loading branch information
ximion committed Aug 26, 2023
1 parent 1fc49da commit 0a6b8ad
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/spears/excuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: LGPL-3.0+

import re
from typing import Dict
from datetime import datetime

Expand Down Expand Up @@ -83,6 +84,15 @@ def _process_log_data(self):
def get_excuses(self) -> Dict[str, SpearsExcuse]:
res = {}

other_reason_ignore_strings = (
'Cannot be tested by piuparts',
'but ignoring cruft, so nevermind',
'Issues preventing migration:',
'Additional info:',
' days old (needed ',
)
debian_buildd_link_re = r'<a href="https://buildd\.debian\.org/status/logs\.php\?arch=[^&]+&pkg=[^&]+&ver=[^"]+" target="_blank">([^<]+)</a>'

# get log data
loginfo = self._process_log_data()

Expand Down Expand Up @@ -151,7 +161,11 @@ def get_excuses(self) -> Dict[str, SpearsExcuse]:
excuse.other = []
for n in entry['excuses']:
s = str(n)
if 'Cannot be tested by piuparts' not in s and 'but ignoring cruft, so nevermind' not in s:
if not any(test in s for test in other_reason_ignore_strings):
if s.startswith('∙ ∙ '):
s = s[4:]
if 'buildd.debian.org' in s:
s = re.sub(debian_buildd_link_re, r'\1', s)
excuse.other.append(s)

# add log information
Expand Down

0 comments on commit 0a6b8ad

Please sign in to comment.