diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-09 11:44:55 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-09 11:44:55 -0800 |
commit | 44b560e25016645fa5a9984cd0ca2e380046a185 (patch) | |
tree | 75883f4c10375062d09100e852bbda2a2226ebdd /scripts/find-duplicates.py | |
download | pattern-tools-44b560e25016645fa5a9984cd0ca2e380046a185.tar.gz pattern-tools-44b560e25016645fa5a9984cd0ca2e380046a185.tar.bz2 pattern-tools-44b560e25016645fa5a9984cd0ca2e380046a185.zip |
initial checkin 001
Diffstat (limited to 'scripts/find-duplicates.py')
-rwxr-xr-x | scripts/find-duplicates.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/find-duplicates.py b/scripts/find-duplicates.py new file mode 100755 index 0000000..c725e92 --- /dev/null +++ b/scripts/find-duplicates.py @@ -0,0 +1,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 |