forked from hroncok/mini-mass-rebuild
-
Notifications
You must be signed in to change notification settings - Fork 1
/
repo_findold.py
49 lines (35 loc) · 1.07 KB
/
repo_findold.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import pathlib
import rpm
SIGNS = {
1: '>',
0: '==',
-1: '<',
}
def split(nevra):
nev, _, ra = nevra.rpartition('-')
n, _, ev = nev.rpartition('-')
e, _, v = ev.rpartition(':')
e = e or '0'
r, _, a = ra.rpartition('.')
if r.endswith('.src'):
r = r[:-4]
return n, (e, v, r)
def main():
python38 = set(pathlib.Path('python38.pkgs').read_text().splitlines())
kojirepo = set(pathlib.Path('koji.repoquery').read_text().splitlines())
py39repo = set(pathlib.Path('python39koji.repoquery').read_text().splitlines())
kojidict = dict(split(pkg) for pkg in kojirepo)
py39dict = dict(split(pkg) for pkg in py39repo)
todo = set()
for pkg in sorted(python38):
if pkg not in py39dict:
continue
sign = SIGNS[rpm.labelCompare(kojidict[pkg], py39dict[pkg])]
print(f'{pkg: <30} {"-".join(kojidict[pkg])} {sign} {"-".join(py39dict[pkg])}')
if sign == '>':
todo.add(pkg)
print()
for pkg in sorted(todo):
print(pkg)
if __name__ == '__main__':
main()