Re: need some help!
Panu Matilainen <[email protected]> Tue, 22 Mar 2005 12:06:15 +0200 (EET)
| Newsgroups | gmane.linux.redhat.rpm.python |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 22 Mar 2005, Basem Narmok wrote:
>
> ya that works, but when I use:#!/usr/bin/python
>
> rpm.addMacro("_dbpath", "/usr/lib/rpmdb/i386-redhat-linux/redhat")
> ts = rpm.TransactionSet()
> ts.openDB()
> rpm.delMacro("_dbpath")
>
> mi=ts.dbMatch("name",sys.argv[1])
> for hdr in mi:
> print "%s-%s-%s" % (hdr["name"], hdr["version"], hdr["release"])
>
> it doesn't !!
Well .. that works for me as well, except that rpmdb-redhat doesn't have
any kernels in it so my previous example doesn't work :) However:
[pmatilai@localhost ~]$ ./pytest.py firefox
firefox-1.0-12.EL4
[pmatilai@localhost ~]$ rpm -q firefox
firefox-1.0.1-1.4.3
Do you actually have rpmdb-redhat package installed? I'd assume yes but
sometimes it's oh so easy to miss the most obvious explanation :)
- Panu -