]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - wwwbin/ac-th-diff.py
Migrate ac-th-diff.py to python3
[projects/pld-ftp-admin.git] / wwwbin / ac-th-diff.py
CommitLineData
f245c555 1#!/usr/bin/python3
ed1ec331
ER
2
3import os
4import re
5import struct
6
7acdir = "/home/ftp/pub/Linux/PLD/dists/ac/PLD/SRPMS/SRPMS"
8thdir = "/home/ftp/pub/Linux/PLD/dists/th/PLD/SRPMS/RPMS/"
9
10thpkg = []
11acpkg = []
12
13ign = '^(xorg-.*|X11-.*|XcursorTheme-.*)$'
14re_c = re.compile(ign)
15
16re_n = re.compile('^(.*)-([^-]*)-([^-]*)$')
17
18def 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
32for rpm in os.listdir(acdir):
33 if re_c.match(rpm):
34 continue
35 acpkg.append(getname(rpm))
36
37for rpm in os.listdir(thdir):
38 if re_c.match(rpm):
39 continue
40 thpkg.append(getname(rpm))
41
42thpkg.sort()
43acpkg.sort()
44
f245c555
JR
45print("*****************************************************")
46print("Packages in AC repo that are not in TH repo:")
ed1ec331
ER
47for pkg in acpkg:
48 if pkg not in thpkg:
f245c555 49 print(pkg)
ed1ec331 50
f245c555
JR
51print()
52print()
53print("*****************************************************")
54print("Packages in TH repo that are not in AC repo:")
ed1ec331
ER
55for pkg in thpkg:
56 if pkg not in acpkg:
f245c555 57 print(pkg)
This page took 1.411507 seconds and 4 git commands to generate.