]>
Commit | Line | Data |
---|---|---|
ed1ec331 ER |
1 | #!/usr/bin/python |
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() | |
25 | #data = struct.unpack("6B2h66s2h16s", rpmlead) | |
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 | ||
45 | print "*****************************************************" | |
46 | print "Packages in AC repo that are not in TH repo:" | |
47 | for pkg in acpkg: | |
48 | if pkg not in thpkg: | |
49 | print pkg | |
50 | ||
51 | ||
52 | ||
53 | print "*****************************************************" | |
54 | print "Packages in TH repo that are not in AC repo:" | |
55 | for pkg in thpkg: | |
56 | if pkg not in acpkg: | |
57 | print pkg |