memset(dircache, 0, sizeof(dircache));
/* get ids of installed rpms */
- entries = getinstalledrpmdbids(&state, "Name", 0, &nentries, &namedata);
+ entries = getinstalledrpmdbids(&state, "Name", 0, &nentries, &namedata, flags & RPMDB_KEEP_GPG_PUBKEY);
if (!entries)
{
freestate(&state);
struct rpmdbentry *entries;
int nentries, i;
- entries = getinstalledrpmdbids(rpmstate, index ? index : "Name", match, &nentries, 0);
+ entries = getinstalledrpmdbids(rpmstate, index ? index : "Name", match, &nentries, 0, 0);
if (rpmdbidq)
{
queue_empty(rpmdbidq);
/* get the rpmdbids of all installed packages from the Name index database.
* This is much faster then querying the big Packages database */
static struct rpmdbentry *
-getinstalledrpmdbids(struct rpmdbstate *state, const char *index, const char *match, int *nentriesp, char **namedatap)
+getinstalledrpmdbids(struct rpmdbstate *state, const char *index, const char *match, int *nentriesp, char **namedatap, int keep_gpg_pubkey)
{
DB_ENV *dbenv = 0;
DB *db = 0;
}
while (dbc->c_get(dbc, &dbkey, &dbdata, match ? DB_SET : DB_NEXT) == 0)
{
- if (!match && dbkey.size == 10 && !memcmp(dbkey.data, "gpg-pubkey", 10))
+ if (!match && !keep_gpg_pubkey && dbkey.size == 10 && !memcmp(dbkey.data, "gpg-pubkey", 10))
continue;
dl = dbdata.size;
dp = dbdata.data;
/* get the rpmdbids of all installed packages from the Name index database.
* This is much faster then querying the big Packages database */
static struct rpmdbentry *
-getinstalledrpmdbids(struct rpmdbstate *state, const char *index, const char *match, int *nentriesp, char **namedatap)
+getinstalledrpmdbids(struct rpmdbstate *state, const char *index, const char *match, int *nentriesp, char **namedatap, int keep_gpg_pubkey)
{
const void * key;
size_t keylen, matchl = 0;
if (keylen != matchl || memcmp(key, match, keylen) != 0)
continue;
}
- else if (keylen == 10 && !memcmp(key, "gpg-pubkey", 10))
+ else if (!keep_gpg_pubkey && keylen == 10 && !memcmp(key, "gpg-pubkey", 10))
continue;
nameoff = namedatal;
if (namedatap)