make yum module work with list=pkgspec

This commit is contained in:
Seth Vidal 2012-08-09 13:22:51 -04:00
parent a7cd16a016
commit 5c458b9761

View file

@ -108,9 +108,9 @@ def repolist(repoq, qf="%{repoid}"):
def list_stuff(conf_file, stuff): def list_stuff(conf_file, stuff):
qf = "%{name}|%{epoch}|%{version}|%{release}|%{arch}|%{repoid}" qf = "%{name}|%{epoch}|%{version}|%{release}|%{arch}|%{repoid}"
repoq = '%s --plugins --quiet -q ' % repoquery repoq = '%s --show-duplicates --plugins --quiet -q ' % repoquery
if conf_file and os.path.exists(conf_file): if conf_file and os.path.exists(conf_file):
repoq = '%s -c %s --plugins --quiet -q ' % (repoquery,conf_file) repoq = '%s -c %s --show-duplicates --plugins --quiet -q ' % (repoquery,conf_file)
if stuff == 'installed': if stuff == 'installed':
return [ pkg_to_dict(p) for p in is_installed(repoq, '-a', qf=qf) if p.strip() ] return [ pkg_to_dict(p) for p in is_installed(repoq, '-a', qf=qf) if p.strip() ]
@ -385,7 +385,7 @@ def main():
pkg=dict(aliases=['name']), pkg=dict(aliases=['name']),
# removed==absent, installed==present, these are accepted as aliases # removed==absent, installed==present, these are accepted as aliases
state=dict(default='installed', choices=['absent','present','installed','removed','latest']), state=dict(default='installed', choices=['absent','present','installed','removed','latest']),
list=dict(choices=['installed','updates','available','repos','pkgspec']), list=dict(),
conf_file=dict(default=None), conf_file=dict(default=None),
) )
) )