]>
Commit | Line | Data |
---|---|---|
f245c555 | 1 | #!/usr/bin/python3 |
ed1ec331 ER |
2 | |
3 | import os | |
4 | import re | |
5 | import struct | |
6 | ||
7 | acdir = "/home/ftp/pub/Linux/PLD/dists/ac/PLD/SRPMS/SRPMS" | |
8 | thdir = "/home/ftp/pub/Linux/PLD/dists/th/PLD/SRPMS/RPMS/" | |
9 | ||
10 | thpkg = [] | |
11 | acpkg = [] | |
12 | ||
13 | ign = '^(xorg-.*|X11-.*|XcursorTheme-.*)$' | |
14 | re_c = re.compile(ign) | |
15 | ||
16 | re_n = re.compile('^(.*)-([^-]*)-([^-]*)$') | |
17 | ||
18 | def getname(file): | |
19 | #f = os.popen('rpm --nomd5 --nodigest --nosignature -qp --queryformat "%{NAME}" ' + file, "r") | |
20 | #name = f.read() | |
21 | #f.close() | |
22 | #f = open(file, 'rb') | |
23 | #rpmlead = f.read(96) | |
24 | #f.close() | |
f245c555 | 25 | #data = struct.unpack(b"6B2h66s2h16s", rpmlead) |
ed1ec331 ER |
26 | #name = data[8].strip() |
27 | #print name | |
28 | m = re_n.match(file) | |
29 | name = m.group(1).strip() | |
30 | return name | |
31 | ||
32 | for rpm in os.listdir(acdir): | |
33 | if re_c.match(rpm): | |
34 | continue | |
35 | acpkg.append(getname(rpm)) | |
36 | ||
37 | for rpm in os.listdir(thdir): | |
38 | if re_c.match(rpm): | |
39 | continue | |
40 | thpkg.append(getname(rpm)) | |
41 | ||
42 | thpkg.sort() | |
43 | acpkg.sort() | |
44 | ||
f245c555 JR |
45 | print("*****************************************************") |
46 | print("Packages in AC repo that are not in TH repo:") | |
ed1ec331 ER |
47 | for pkg in acpkg: |
48 | if pkg not in thpkg: | |
f245c555 | 49 | print(pkg) |
ed1ec331 | 50 | |
f245c555 JR |
51 | print() |
52 | print() | |
53 | print("*****************************************************") | |
54 | print("Packages in TH repo that are not in AC repo:") | |
ed1ec331 ER |
55 | for pkg in thpkg: |
56 | if pkg not in acpkg: | |
f245c555 | 57 | print(pkg) |