summaryrefslogtreecommitdiff
path: root/scripts/find-duplicates.py
blob: c725e922140a1baa458fd391c1c1ac15110c0a2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python

import xml.etree.ElementTree as ET
import sys

tree1 = ET.parse(sys.argv[1])
tree2= ET.parse(sys.argv[2])

namespace="http://linux.duke.edu/metadata/rpm"
req1 = tree1.findall('.//{%s}entry' % namespace)
req2 = tree2.findall('.//{%s}entry' % namespace)
l2 = []
l1 = []
for r in req1:
    l1.append(r.attrib.get("name"))
for r in req2:
    l2.append(r.attrib.get("name"))

s1 = set(sorted(l1))
s2 = set(sorted(l2))
intersection = s1 & s2
for i in intersection:
    print i