From 336a60ce0be198f8a0aa910a8ec0c27737f2a346 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 15 Jul 2009 18:37:29 +0200 Subject: [PATCH] - allow index and match specification in getinstalledrpmdbids() --- ext/repo_rpmdb.c | 6 ++++-- ext/repo_rpmdb.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index d9c7849..911f1af 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -2185,19 +2185,21 @@ getinstalledrpmdbids(struct rpm_by_state *state, const char *index, const char * } int -rpm_installedrpmdbids(const char *rootdir, Queue *rpmdbidq) +rpm_installedrpmdbids(const char *rootdir, const char *index, const char *match, Queue *rpmdbidq) { struct rpm_by_state state; struct rpmdbentry *entries; int nentries, i; char *namedata; + if (!index) + index = "Name"; if (rpmdbidq) queue_empty(rpmdbidq); memset(&state, 0, sizeof(state)); if (!(state.dbenv = opendbenv(rootdir))) return 0; - entries = getinstalledrpmdbids(&state, "Name", 0, &nentries, &namedata, 0); + entries = getinstalledrpmdbids(&state, index, match, &nentries, &namedata, 0); if (rpmdbidq) for (i = 0; i < nentries; i++) queue_push(rpmdbidq, entries[i].rpmdbid); diff --git a/ext/repo_rpmdb.h b/ext/repo_rpmdb.h index e5856e4..78dd2f3 100644 --- a/ext/repo_rpmdb.h +++ b/ext/repo_rpmdb.h @@ -32,4 +32,4 @@ void *rpm_byrpmh(struct headerToken_s *h, void **statep); char *rpm_query(void *rpmhandle, Id what); void rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char *, int, const char *), void *cbdata); -int rpm_installedrpmdbids(const char *rootdir, Queue *rpmdbidq); +int rpm_installedrpmdbids(const char *rootdir, const char *index, const char *match, Queue *rpmdbidq); -- 2.7.4