Skip to content
Snippets Groups Projects
Commit 12c76f0d authored by Jelle van der Waa's avatar Jelle van der Waa :construction: Committed by Jelle van der Waa
Browse files

flyspray: add removed packages script

This script goes through all open bugs in the Arch Linux and Community
tracker and extracts the packagename from "[$pkgname]" and tries match
it to the list of packages in the repo. If there is no match the package
is assumed to be dropped from the repo and printed.

This script will give false positives, but not enough which requires
some extra filtering.
parent c366ae07
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
from re import search
from subprocess import check_output
import sqlalchemy
REGEX = r'\[([A-Za-z0-9_-]+)\]'
packages = check_output(['/usr/bin/pacman', '-Slq']).decode().splitlines()
engine = sqlalchemy.create_engine('mysql://localhost/flyspray', connect_args={'read_default_file': '/root/.my.cnf'})
with engine.connect() as conn:
result = conn.execute("SELECT task_id,item_summary from flyspray_tasks where is_closed=0 and project_id in (1,5)")
for row in result:
m = search(REGEX, row['item_summary'])
if not m:
continue
pkgname = m.group(1)
if pkgname not in packages:
task_id = row['task_id']
print(f'Removed package {pkgname} found - https://bugs.archlinux.org/task/{task_id}')
......@@ -91,3 +91,6 @@
- name: Start and enable systemd socket
service: name=php-fpm7@flyspray.socket state=started enabled=true
- name: Copy removed package bugs script
copy: src=removed-packages-bugs.py dest=/usr/local/bin/removed-packages-bugs.py mode=0755 owner=root group=root
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment