Func Verification Method – Release 0.9 Beta

Release 0.9 Beta of the Verification Method is done, the support for glob queries in the code has been added.

http://zenit.senecac.on.ca/wiki/index.php/Func/Rpms_Module_-_Function_Verify

http://func.pastebin.com/f59ccf2f7

def verify(self, pattern=”, flatten=True):
“””
Returns information of the verification of all installed packages.
“””
print “”
# 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)[0]
if flatten:
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))
else:
results.append(“%s-%s-%s.%s” % (name, version, release, arch))
return results

I would like to thank Greg for his help.

func-logo-small1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: