Add some patterns for demo and other support
[profile/ivi/package-groups.git] / scripts / find-duplicates.py
1 #!/usr/bin/python
2
3 import xml.etree.ElementTree as ET
4 import sys
5
6 tree1 = ET.parse(sys.argv[1])
7 tree2= ET.parse(sys.argv[2])
8
9 namespace="http://linux.duke.edu/metadata/rpm"
10 req1 = tree1.findall('.//{%s}entry' % namespace)
11 req2 = tree2.findall('.//{%s}entry' % namespace)
12 l2 = []
13 l1 = []
14 for r in req1:
15     l1.append(r.attrib.get("name"))
16 for r in req2:
17     l2.append(r.attrib.get("name"))
18
19 s1 = set(sorted(l1))
20 s2 = set(sorted(l2))
21 intersection = s1 & s2
22 for i in intersection:
23     print i