I'm trying to find out how I can compare 2 lists of RPMS (Currently installed) and (Available in local repository) and see which RPMS are out of date. I've been tinkering with regex but there are so many different naming standards for RPMS that i can't get a good list to work with. I don't have the actual RPMS on my drive so i can't do rpm -qif.
pattern1 = re.compile(r'^([a-zA-Z0-9_\-\+]*)-([a-zA-Z0-9_\.]*)-([a-zA-Z0-9_\.]*)\.(.*)')
for rpm in listOfRpms:
packageInfo = pattern1.search(rpm[0]).groups()
print packageInfo
This works for a vast majority but not all (2300 / 2400)
yum-metadata-parser-1.1.2-2.el5 ('yum-metadata-parser', '1.1.2', '2', 'el5') **What I need
But none these work for instance unless I break some others that worked before.. wvdial-1.54.0-3 xdelta-1.1.3-20 xdelta-1.1.3-20_2 xmlsec1-1.2.6-3 xmlsec1-1.2.6-3_2 ypbind-1.17.2-13 ypbind-1.17.2-8 ypserv-2.13-14 zip-2.3-27 zlib-1.2.3-3 zlib-1.2.3-3_2 zsh-4.2.6-1