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
|
#!/usr/bin/python2
import sys
import logging
import apt_pkg
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO,
format="%(asctime)s %(message)s")
if len(sys.argv) < 3:
print "need a Packages file and a Translations file"
sys.exit(1)
# read Packages
packages = set()
rt = apt_pkg.ParseTagFile(open(sys.argv[1]))
while rt.Step():
packages.add(rt.Section.get("Package"))
rt = apt_pkg.ParseTagFile(open(sys.argv[2]))
while rt.Step():
pkg = rt.Section.get("Package")
if not pkg in packages:
logging.warn("Package in translation but not in packages file: '%s'\n" % pkg)
continue
print rt.Section
|