Gabriel M. Elder wrote:
Anybody know of a way, using package management tools (or
otherwise), to query an rpm database for a list of all installed
packages from a specified vendor and/or matching a given gpg key?
For instance, i want a list of all freshrpms packages that i
currently have installed. I figure the simplest way to find out is
to (politely) ask the rpm database for a list of all installed
packages from this vendor, and/or signed with that gpg key.
You can do either or both with rpm (and a little help from grep. I
have FreshRPMS on an old FC4 box and it looks to me like all of
Mattias' packages have a proper vendor tag which would seem like the
easiest way to query for them.
Get a list of
FreshRPMS.net packages:
$ rpm -qa --qf '%{vendor}:%{name}\n' | grep 'Freshrpms\.net' | cut -d:
-f2-
Getting the signature requires a little more voodoo if you want to be
sure to get both RSA and DSA signs made with either gpg or pgp, but it
can be done. Here's something I stole from a post on fedora-extras
list[1]:
$ rpm -qa --qf
'%{name}\t%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{%|SIGGPG?{%{SIGGPG:pgpsig}}:{%|SIGPGP?{%{SIGPGP:pgpsig}}:{(none)}|}|}|}|\n'
| grep e42d547b
That's not really the most user friendly thing in the world, but you
can probably bend it into a shape can use. The popt alias used in the
fedora-extras-list post offers some nice possibilities.
[1]
https://www.redhat.com/archives/fedora-extras-list/2006-December/msg00659...
HTH,
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL:
www.pobox.com/~tmz/pgp
======================================================================
In some cultures what I do would be considered normal.