projects
/
platform
/
upstream
/
libsolv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.6.35
[platform/upstream/libsolv.git]
/
ext
/
repo_rpmdb_librpm.h
diff --git
a/ext/repo_rpmdb_librpm.h
b/ext/repo_rpmdb_librpm.h
index
802c5d1
..
79983d3
100644
(file)
--- a/
ext/repo_rpmdb_librpm.h
+++ b/
ext/repo_rpmdb_librpm.h
@@
-111,10
+111,10
@@
closepkgdb(struct rpmdbstate *state)
/* 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 *
/* 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;
{
const void * key;
- size_t keylen;
+ size_t keylen
, matchl = 0
;
Id nameoff;
char *namedata = 0;
Id nameoff;
char *namedata = 0;
@@
-125,20
+125,26
@@
getinstalledrpmdbids(struct rpmdbstate *state, const char *index, const char *ma
rpmdbIndexIterator ii;
int i;
rpmdbIndexIterator ii;
int i;
+ *nentriesp = 0;
+ if (namedatap)
+ *namedatap = 0;
+
if (state->dbenvopened != 1 && !opendbenv(state))
return 0;
if (state->dbenvopened != 1 && !opendbenv(state))
return 0;
+ if (match)
+ matchl = strlen(match);
ii = rpmdbIndexIteratorInit(rpmtsGetRdb(state->ts), RPMDBI_NAME);
ii = rpmdbIndexIteratorInit(rpmtsGetRdb(state->ts), RPMDBI_NAME);
- *nentriesp = 0;
- if (namedatap)
- *namedatap = 0;
-
while (rpmdbIndexIteratorNext(ii, &key, &keylen) == 0)
{
while (rpmdbIndexIteratorNext(ii, &key, &keylen) == 0)
{
-
- if (keylen == 10 && !memcmp(key, "gpg-pubkey", 10))
- continue;
+ if (match)
+ {
+ if (keylen != matchl || memcmp(key, match, keylen) != 0)
+ continue;
+ }
+ else if (!keep_gpg_pubkey && keylen == 10 && !memcmp(key, "gpg-pubkey", 10))
+ continue;
nameoff = namedatal;
if (namedatap)
{
nameoff = namedatal;
if (namedatap)
{