RPM Community Forums

Mailing List Message of <rpm-users>

How to query using RPM NVRA

From: Navid Shaikh <shaikhnavid14@gmail.com>
Date: Mon 24 Mar 2014 - 18:57:02 CET
Message-ID: <CAOd3oer0MXEqpVGzf9Q6XTz3LFdD7h60jsbx74vUN=8BteHA3g@mail.gmail.com>
Hi folks,
I am exploring rpm python module.
There are couple of thing I am stuck at:
1. How do one query using RPM NVRA?

#I can query using RPM name as:
import rpm
ts = rpm.TransactionSet()
mi = ts.dbMatch(rpm.RPMTAG_NAME, 'httpd' )
for hdr in mi:
    print hdr[rpm.RPMTAG_NVRA]

# I got output: httpd-2.4.7-1.fc19.x86_64

However, when I am trying

mi = ts.dbMatch(rpm.RPMTAG_NVRA, 'httpd-2.4.7-1.fc19.x86_64')
for hdr in mi:
    print hdr[rpm.NAME]
#I don't see any output

where am I doing wrong?

2. How I can extract Signature of an installed rpm using rpm python module?

Thanks and Regards,
Navid Shaikh
Received on Tue Mar 25 07:04:47 2014
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.