Release 0.9 Beta of the Verification Method is done, the support for glob queries in the code has been added.
def verify(self, pattern=”, flatten=True):
Returns information of the verification of all installed packages.
# For some reason, if this print is removed, the previous one does not happen until the lines after this have been evaluated. – Greg.
ts = rpm.TransactionSet()
mi = (ts.dbMatch() if pattern == ” else self.glob(pattern))
results = 
for hdr in mi:
name = hdr[‘name’] if pattern == ” else split(“\s”,hdr)
yb = yum.YumBase()
pkgs = yb.rpmdb.searchNevra(name)
for pkg in pkgs:
errors = pkg.verify()
for fn in errors.keys():
for prob in errors[fn]:
results.append(‘%s %s %s’ % (name, fn, prob.message))
results.append(“%s-%s-%s.%s” % (name, version, release, arch))
I would like to thank Greg for his help.