From: Peter van Dijk Date: Fri, 21 Oct 2022 09:14:41 +0000 (+0200) Subject: daily job: check debian autoremovals X-Git-Tag: dnsdist-1.8.0-rc1~266^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12115%2Fhead;p=thirdparty%2Fpdns.git daily job: check debian autoremovals --- diff --git a/.github/workflows/misc-dailies.yml b/.github/workflows/misc-dailies.yml index c3986dbc37..04771121c4 100644 --- a/.github/workflows/misc-dailies.yml +++ b/.github/workflows/misc-dailies.yml @@ -19,3 +19,14 @@ jobs: echo "::notice ::No newer devtoolset exists (good)" exit 0 fi + + check-debian-autoremovals: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3.1.0 + with: + fetch-depth: 5 + submodules: recursive + + - name: Check if Debian is about to toss us off a balcony + run: ./build-scripts/check-debian-autoremovals.py diff --git a/build-scripts/check-debian-autoremovals.py b/build-scripts/check-debian-autoremovals.py new file mode 100755 index 0000000000..583c4fd7d9 --- /dev/null +++ b/build-scripts/check-debian-autoremovals.py @@ -0,0 +1,57 @@ +#!/usr/bin/python3 +import yaml +import requests +import sys +import re + +def getTitleForBugs(bugs): + ret = [] + title_regex = re.compile(r'(.*) - Debian Bug report logs') + for bug in bugs: + bug_r = requests.get('https://bugs.debian.org/cgi-bin/bugreport.cgi', params={'bug':bug}) + lines = bug_r.text.split('\n') + for line in lines: + match = title_regex.search(line) + if match: + ret.append(match.group(1)) + break + return ret + + +r = requests.get('https://udd.debian.org/cgi-bin/autoremovals.yaml.cgi') +data = yaml.load(r.text, Loader=yaml.SafeLoader) +msg = '' + +keys = ['pdns', 'pdns-recursor', 'dnsdist'] + +removals = [] + +for key in keys: + if not key in data.keys(): + continue + removals.append(key) + msg += "::warning ::%s slated for removal from Debian on %s (https://tracker.debian.org/pkg/%s) " % (key, data[key]['removal_date'], key) + if data[key]['dependencies_only']: + msg += "because there are bugged dependencies.\n\n" + else: + msg += "because of a bug in PowerDNS!\n\n" + + bugs = getTitleForBugs(data[key].get('bugs_dependencies', [])) + if len(bugs): + msg += "This is caused by the following dependency bug%s:\n " % ('s' if len(bugs) > 1 else '') + msg += '\n '.join(bugs) + + bugs = getTitleForBugs(data[key]['bugs']) + if len(bugs): + msg += "This is caused by the following bug%s in PowerDNS:\n " % ('s' if len(bugs) > 1 else '') + msg += '\n '.join(bugs) + + msg += "\n" + + print(msg) + +if removals: + sys.exit(1) +else: + print("::notice ::No packages marked for autoremoval from Debian (yay!)") + sys.exit(0)