summaryrefslogtreecommitdiff
path: root/wwwbin/ac-th-diff.py
blob: d8d0362366c6c8878baf2ac9caeec744a0479c43 (plain)
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
50
51
52
53
54
55
56
57
#!/usr/bin/python3

import os
import re
import struct

acdir = "/home/ftp/pub/Linux/PLD/dists/ac/PLD/SRPMS/SRPMS"
thdir = "/home/ftp/pub/Linux/PLD/dists/th/PLD/SRPMS/RPMS/"

thpkg = []
acpkg = []

ign = '^(xorg-.*|X11-.*|XcursorTheme-.*)$'
re_c = re.compile(ign)

re_n = re.compile('^(.*)-([^-]*)-([^-]*)$')

def getname(file):
	#f = os.popen('rpm --nomd5 --nodigest --nosignature -qp --queryformat "%{NAME}" ' + file, "r")
	#name = f.read()
	#f.close()
	#f = open(file, 'rb')
	#rpmlead = f.read(96)
	#f.close()
	#data = struct.unpack(b"6B2h66s2h16s", rpmlead)
	#name = data[8].strip()
	#print name
	m = re_n.match(file)
	name =  m.group(1).strip()
	return name

for rpm in os.listdir(acdir):
	if re_c.match(rpm):
		continue
	acpkg.append(getname(rpm))

for rpm in os.listdir(thdir):
	if re_c.match(rpm):
		continue
	thpkg.append(getname(rpm))

thpkg.sort()
acpkg.sort()

print("*****************************************************")
print("Packages in AC repo that are not in TH repo:")
for pkg in acpkg:
	if pkg not in thpkg:
		print(pkg)

print()
print()
print("*****************************************************")
print("Packages in TH repo that are not in AC repo:")
for pkg in thpkg:
	if pkg not in acpkg:
		print(pkg)