hai there i got a question related with rpm
for mi in ts.dbMatch ('name', 'kernel'):
it searches for kernel good. now I want it to search for 'hypervisor' ?
it is not a 'release'
how should i proceed?
Chitlesh GOORAH wrote:
hai there i got a question related with rpm
for mi in ts.dbMatch ('name', 'kernel'):
it searches for kernel good. now I want it to search for 'hypervisor' ?
it is not a 'release'
how should i proceed?
What about something like this
for mi in ts.dbMatch ('name', 'kernel'): name = mi['name'] if name.find('hypervisor') <> -1: # Do the stuff
Tim Lauridsen
On Fri, 2006-02-24 at 08:04 +0100, Tim Lauridsen wrote:
Chitlesh GOORAH wrote:
What about something like this
for mi in ts.dbMatch ('name', 'kernel'): name = mi['name'] if name.find('hypervisor') <> -1: # Do the stuff
Or you could use mi.pattern mi = ts.dbMatch() mi.pattern("name",rpm.RPMMIRE_GLOB,"kernel*hypervisor")
Paul
On 2/28/06, Paul Nasrat pnasrat@redhat.com wrote:
On Fri, 2006-02-24 at 08:04 +0100, Tim Lauridsen wrote:
Chitlesh GOORAH wrote:
What about something like this
for mi in ts.dbMatch ('name', 'kernel'): name = mi['name'] if name.find('hypervisor') <> -1: # Do the stuff
Or you could use mi.pattern mi = ts.dbMatch() mi.pattern("name",rpm.RPMMIRE_GLOB,"kernel*hypervisor")
Paul
Ill try yours in a few, Ive came up to this for the moment which might not be the perfect algo:
def xen_is_installed(rootdir): clear_rpm_db_files (rootdir) ts = rpm.TransactionSet(rootdir) for mi in ts.dbMatch (): name = mi['name'] if name.find('hypervisor') <> -1: # for /lib/modules kernel_version = "%s-%s%s" % (mi['version'], mi['release'], 'hypervisor') clear_rpm_db_files (rootdir) return kernel_version
Chitlesh GOORAH -- http://clunixchit.blogspot.com
devel@lists.stg.fedoraproject.org